Idris2/tests/idris2/basic063/NoDeclaration.idr
G. Allais 00ab9573a5
[ re #1944 ] Allow toplevel aliases (#1952)
* [ re #1944 ] Allow simple toplevel aliases
* [ done ] toplevel aliases with arguments
* [ fix ] weird nonsensical test case
* [ fix ] golden test files
2021-10-13 21:55:23 +01:00

24 lines
408 B
Idris

module NoDeclaration
identity : (a : Type) -> a -> a
identity _ x = x
idNat = identity Nat
double = (S 1 *)
test : idNat (double 3) === 6
test = Refl
unwords : List String -> String
unwords [] = ""
unwords [x] = x
unwords (x::xs) = x ++ " " ++ unwords xs
helloWorld = unwords ["hello", "world"]
test' : NoDeclaration.helloWorld === "hello world"
test' = Refl
cat x y = unwords [x, show {ty = Nat} y]