mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-19 01:01:59 +03:00
3120fcb84a
This is mostly to make it easier to write linear function types without having to invent names for everything, which might be noisy. Also it improves the display of linear function types when the name isn't used in the scope.
9 lines
431 B
Plaintext
9 lines
431 B
Plaintext
1/1: Building CaseBlock (CaseBlock.idr)
|
|
Main> Main.foo : (x : Nat) -> (case x of { 0 => Nat -> Nat ; S k => Nat })
|
|
Main> Prelude.elem : Eq a => a -> List a -> Bool
|
|
elem x [] = False
|
|
elem x (y :: ys) = if x == y then True else elem x ys
|
|
Main> PrimIO.io_bind : (1 _ : IO a) -> (1 _ : (a -> IO b)) -> IO b
|
|
io_bind (MkIO fn) k = MkIO (\1 w => (case fn w of { MkIORes x' w' => case k x' of { MkIO res => res w' } }))
|
|
Main> Bye for now!
|