def
tripleBind
{m : Type u_1 → Type u_2}
{α : Type u_1}
{β : Type u_1}
{γ : Type u_1}
{δ : Type u_1}
[Monad m]
(f : α → β → γ → m δ)
(triple : m α × m β × m γ)
:
m δ
Equations
- tripleBind f triple = do let __do_lift ← triple.1 let __do_lift_1 ← triple.2.1 let __do_lift_2 ← triple.2.2 f __do_lift __do_lift_1 __do_lift_2
Instances For
def
tripleMapM
{m : Type u_1 → Type u_2}
{α : Type u_1}
{β : Type u_1}
{γ : Type u_1}
{δ : Type u_1}
[Monad m]
(f : α → β → γ → δ)
(triple : m α × m β × m γ)
:
m δ
Equations
- tripleMapM f triple = do let __do_lift ← triple.1 let __do_lift_1 ← triple.2.1 let __do_lift_2 ← triple.2.2 pure (f __do_lift __do_lift_1 __do_lift_2)
Instances For
- nil: {α : Type u} → LengthIndexedList α 0
- cons: {α : Type u} → {n : ℕ} → α → LengthIndexedList α n → LengthIndexedList α (n + 1)
Instances For
instance
instReprLengthIndexedList :
{α : Type u_1} → {a : ℕ} → [inst : Repr α] → Repr (LengthIndexedList α a)
Equations
- instReprLengthIndexedList = { reprPrec := reprLengthIndexedList✝ }
instance
instDecidableEqLengthIndexedList :
{α : Type u_1} → {a : ℕ} → [inst : DecidableEq α] → DecidableEq (LengthIndexedList α a)
Equations
- instDecidableEqLengthIndexedList = decEqLengthIndexedList✝
Equations
- LengthIndexedList.fromList [] = LengthIndexedList.nil
- LengthIndexedList.fromList (x :: xs) = LengthIndexedList.cons x (LengthIndexedList.fromList xs)
Instances For
def
LengthIndexedList.map
{α : Type u}
{β : Type u}
(f : α → β)
{n : ℕ}
:
LengthIndexedList α n → LengthIndexedList β n
Equations
- LengthIndexedList.map f LengthIndexedList.nil = LengthIndexedList.nil
- LengthIndexedList.map f (LengthIndexedList.cons a_2 a_3) = LengthIndexedList.cons (f a_2) (LengthIndexedList.map f a_3)
Instances For
def
LengthIndexedList.foldl
{α : Type u}
{β : Type u}
{n : ℕ}
(f : β → α → β)
(acc : β)
:
LengthIndexedList α n → β
Equations
- LengthIndexedList.foldl f acc LengthIndexedList.nil = acc
- LengthIndexedList.foldl f acc (LengthIndexedList.cons a_2 a_3) = LengthIndexedList.foldl f (f acc a_2) a_3
Instances For
def
LengthIndexedList.zipWith
{α : Type u}
{β : Type u}
{γ : Type u}
{n : ℕ}
(f : α → β → γ)
:
LengthIndexedList α n → LengthIndexedList β n → LengthIndexedList γ n
Equations
- LengthIndexedList.zipWith f LengthIndexedList.nil LengthIndexedList.nil = LengthIndexedList.nil
- LengthIndexedList.zipWith f (LengthIndexedList.cons x_2 xs) (LengthIndexedList.cons y ys) = LengthIndexedList.cons (f x_2 y) (LengthIndexedList.zipWith f xs ys)
Instances For
Equations
- (LengthIndexedList.cons x a).nth ⟨0, isLt⟩ = x
- (LengthIndexedList.cons a xs).nth ⟨i_2.succ, h⟩ = xs.nth ⟨i_2, ⋯⟩
Instances For
instance
LengthIndexedList.instGetElemNatLt
{α : Type u_1}
{n : ℕ}
:
GetElem (LengthIndexedList α n) ℕ α fun (_xs : LengthIndexedList α n) (i : ℕ) => i < n
Equations
- LengthIndexedList.instGetElemNatLt = { getElem := fun (xs : LengthIndexedList α n) (i : ℕ) (h : i < n) => xs.nth ⟨i, h⟩ }
def
LengthIndexedList.NatEq
{α : Type u}
{n : ℕ}
{m : ℕ}
:
n = m → LengthIndexedList α n → LengthIndexedList α m
Equations
- LengthIndexedList.NatEq ⋯ l = l
Instances For
Equations
- LengthIndexedList.finRange 0 = LengthIndexedList.nil
- LengthIndexedList.finRange m.succ = LengthIndexedList.cons ⟨m, ⋯⟩ (LengthIndexedList.map (Fin.coeLt ⋯) (LengthIndexedList.finRange m))
Instances For
Equations
- tacticPrint_goal_as_error = Lean.ParserDescr.node `tacticPrint_goal_as_error 1024 (Lean.ParserDescr.nonReservedSymbol "print_goal_as_error " false)
Instances For
Equations
- Vector.ofList l = ⟨l, ⋯⟩
Instances For
Equations
- Vector.ofArray a = Vector.ofList a.toList
Instances For
Equations
- One or more equations did not get rendered due to their size.
productsList [xs, ys] = [(x, y) for x in xs for y in ys], extended to arbitary number of arrays.
Equations
- One or more equations did not get rendered due to their size.
- productsList [] = [[]]
Instances For
Builds the cartesian product of all arrays in the input. Pretty inefficient right now, as it converts back and forth to lists...
Equations
- productsArr arr = (List.map List.toArray (productsList ((List.map Array.toList ∘ Array.toList) arr))).toArray