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 fstpair.1 let sndpair.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_lifttriple.1 let __do_lift_1triple.2.1 let __do_lift_2triple.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 fstpair.1 let sndpair.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_lifttriple.1 let __do_lift_1triple.2.1 let __do_lift_2triple.2.2 pure (f __do_lift __do_lift_1 __do_lift_2)
          Instances For
            def Fin.coeLt {n : } {m : } :
            n mFin nFin 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 = mLengthIndexedList α nLengthIndexedList α 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