mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-27 13:43:28 +03:00
c9b20911e1
I'm playing with some linear structures and finding these useful a lot, so good to have a consistent syntax for it. '#' is chosen because it's short, looks a bit like a cross if you look at it from the right angle (!) and so as not to clash with '@@' in preorder reasoning syntax.
18 lines
524 B
Plaintext
18 lines
524 B
Plaintext
1/1: Building Door (Door.idr)
|
|
Main> (val # y) => ?now_4
|
|
Main> (True # d) => ?now_4
|
|
(False # d) => ?now_5
|
|
Main> 0 m : Type -> Type
|
|
1 d : Door Open
|
|
x : Integer
|
|
0 r : Res Bool (\r => (Door (if r then Open else Closed)))
|
|
-------------------------------------
|
|
now_2 : Use Many m ()
|
|
Main> 0 m : Type -> Type
|
|
1 d : Door Closed
|
|
x : Integer
|
|
0 r : Res Bool (\r => (Door (if r then Open else Closed)))
|
|
-------------------------------------
|
|
now_3 : Use Many m ()
|
|
Main> Bye for now!
|