mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-12-18 18:31:43 +03:00
288a92424a
For example, delayed elaborators. If it resolves one, and it's not a complete solution, we might end up with unsolved holes. Or - possibly worse - we might end up with an error in a program that is silently fixed rather than reported! Fixes #223
28 lines
803 B
Idris
28 lines
803 B
Idris
data Name : Type where
|
|
MN : Int -> Name
|
|
|
|
data IsVar : Name -> List Name -> Type where
|
|
First : IsVar n (n :: ns)
|
|
Later : IsVar n ns -> IsVar n (m :: ns)
|
|
|
|
data Expr : List Name -> Type where
|
|
CLocal : (prf : IsVar x vars) -> Expr vars
|
|
|
|
data FunDecl : Type where
|
|
MkFunDecl : (vars : List Name) -> Expr vars -> FunDecl
|
|
|
|
funDeclWorks : List FunDecl
|
|
funDeclWorks = [MkFunDecl [MN 0] (CLocal First)]
|
|
|
|
foo : Expr [MN 0]
|
|
foo = CLocal First
|
|
|
|
dpairFails : List (vars : List Name ** Expr vars)
|
|
dpairFails = [([MN 0] ** CLocal First)]
|
|
|
|
dpairWithExtraInfoWorks : List (vars : List Name ** Expr vars)
|
|
dpairWithExtraInfoWorks = [([MN 0] ** CLocal {x=MN 0} (First {ns=[]}))]
|
|
|
|
dpairWithExtraInfoBad : List (vars : List Name ** Expr vars)
|
|
dpairWithExtraInfoBad = [([MN 0] ** CLocal {x=MN 0} (First {ns=[MN 0]}))]
|