Tests on default args and substitution
test/proof005/DefaultArgSubstitutionSuccess.idrnew file+27
@@ -0,0 +1,27 @@
1+module DefaultArgSubstitutionSuccess
3+DecProofType : {a:Type} -> Dec a -> Type
4+DecProofType {a} (Yes _) = a
5+DecProofType {a} (No _) = a -> _|_
7+decProof : {a:Type} -> (dec : Dec a) -> DecProofType dec
11+DecType : {a:Type} -> Dec a -> Type
15+argsAreSame : (n:Nat) -> (m:Nat)
16+ -> { default (decProof (decEq m n)) same : (m=n) } -> ()
19+data SameNats : Type where
20+ same : (n:Nat) -> (m:Nat) ->
21+ { default (decProof (decEq m n)) same : (m=n) } -> SameNats
24+zArgsAreSame = argsAreSame Z Z
test/proof005/expectednew file
No changes to the content.
test/proof005/runnew file+3
@@ -0,0 +1,3 @@
2+idris --check $@ DefaultArgSubstitutionSuccess.idr
test/proof006/DefaultArgSubstitutionSyntax.idrnew file+30
@@ -0,0 +1,30 @@
1+module DefaultArgSubstitutionSyntax
3+DecProofType : {a:Type} -> Dec a -> Type
4+DecProofType {a} (Yes _) = a
5+DecProofType {a} (No _) = a -> _|_
7+decProof : {a:Type} -> (dec : Dec a) -> DecProofType dec
11+DecType : {a:Type} -> Dec a -> Type
15+syntax "{{" [prfname] ":" "accept" [dec] "}}" "->" [ret]
16+ = { default (decProof dec) prfname : DecType dec } -> ret
19+argsAreSame : (n:Nat) -> (m:Nat)
20+ -> {{ same : accept (decEq n m) }} -> ()
23+data SameNats : Type where
24+ same : (n:Nat) -> (m:Nat) -> {{ same : accept (decEq m n) }} -> SameNats
27+zArgsAreSame = argsAreSame Z Z
test/proof006/expectednew file
No changes to the content.
test/proof006/runnew file+3
@@ -0,0 +1,3 @@
2+idris --check $@ DefaultArgSubstitutionSyntax.idr
test/proof007/DefaultArgUnknownName.idrnew file+4
@@ -0,0 +1,4 @@
1+module DefaultArgUnknownName
3+funWithBadDefArg : { default sadgjhsag arg : () } -> ()
4+funWithBadDefArg : _ = ()
test/proof007/expectednew file+1
@@ -0,0 +1 @@
1+No such variable sadgjhsag
test/proof007/runnew file+3
@@ -0,0 +1,3 @@
2+idris --check $@ DefaultArgUnknownName.idr