Documentation

SSA.Core.Util

def uncurry {α : Type u_1} {β : Type u_2} {γ : Sort u_3} (f : α → β → γ) (pair : α × β) :
γ
Equations
Instances For
    def pairBind {m : Type u_1 → Type u_2} {α : Type u_1} {β : Type u_1} {γ : Type u_1} [Monad m] (f : α → β → m γ) (pair : m α × m β) :
    m γ
    Equations
    • pairBind f pair = do let fst ← pair.1 let snd ← pair.2 f fst snd
    Instances For
      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 pairMapM {m : Type u_1 → Type u_2} {α : Type u_1} {β : Type u_1} {γ : Type u_1} [Monad m] (f : α → β → γ) (pair : m α × m β) :
        m γ
        Equations
        • pairMapM f pair = do let fst ← pair.1 let snd ← pair.2 pure (f fst snd)
        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
            def Fin.coeLt {n : ℕ} {m : ℕ} :
            n ≤ m → Fin n → Fin m
            Equations
            Instances For
              inductive LengthIndexedList (α : Type u) :
              ℕ → Type u
              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✝
                def LengthIndexedList.map {α : Type u} {β : Type u} (f : α → β) {n : ℕ} :
                Equations
                Instances For
                  def LengthIndexedList.foldl {α : Type u} {β : Type u} {n : ℕ} (f : β → α → β) (acc : β) :
                  LengthIndexedList α n → β
                  Equations
                  Instances For
                    def LengthIndexedList.zipWith {α : Type u} {β : Type u} {γ : Type u} {n : ℕ} (f : α → β → γ) :
                    Equations
                    Instances For
                      def LengthIndexedList.nth {α : Type u} {n : ℕ} (l : LengthIndexedList α n) (i : Fin n) :
                      α
                      Equations
                      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
                        Instances For
                          Equations
                          Instances For
                            def Vector.ofList {α : Type u} (l : List α) :
                            Mathlib.Vector α l.length
                            Equations
                            Instances For
                              def Vector.ofArray {α : Type u} (a : Array α) :
                              Mathlib.Vector α a.size
                              Equations
                              Instances For
                                Equations
                                • One or more equations did not get rendered due to their size.
                                def productsList {α : Type u_1} :
                                List (List α) → List (List α)

                                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
                                  def productsArr {α : Type u_1} :
                                  Array (Array α) → Array (Array α)

                                  Builds the cartesian product of all arrays in the input. Pretty inefficient right now, as it converts back and forth to lists...

                                  Equations
                                  Instances For