mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-21 02:31:50 +03:00
00ab9573a5
* [ re #1944 ] Allow simple toplevel aliases * [ done ] toplevel aliases with arguments * [ fix ] weird nonsensical test case * [ fix ] golden test files
24 lines
408 B
Idris
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]
|