Heterogeneous Lists #
We define HList
as a synonym for List (Σ α : Type u, α)
, namely a list of types together with
a value.
We note some other implementations of HList
:
- Soup
- Part of Certified Programming with Dependent Types (it's in Coq, but can be translated to Lean)
Our choice of definition is so that we can directly rely on the existing API for List
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- HList.«term_::ₕ_» = Lean.ParserDescr.trailingNode `HList.«term_::ₕ_» 67 68 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ::ₕ ") (Lean.ParserDescr.cat `term 67))
Instances For
@[simp]
Equations
- HList.ofDVec l = List.map (fun (i : Fin n) => ⟨α i, l i⟩) (List.finRange n)
Instances For
Equivalent between HList.getValue
and HList.toDVec