mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-19 01:01:59 +03:00
28 lines
375 B
Idris
28 lines
375 B
Idris
namespace MyDo
|
|
export
|
|
(>>=) : a -> (a -> IO b) -> IO b
|
|
(>>=) val k = k val
|
|
|
|
foo : IO ()
|
|
foo = MyDo.do
|
|
x <- "Silly"
|
|
putStrLn x
|
|
|
|
namespace A
|
|
namespace B
|
|
export
|
|
(>>=) : Nat -> (() -> Nat) -> Nat
|
|
(>>=) x fy = x + (fy ())
|
|
|
|
test : Nat
|
|
test = B.A.do
|
|
5
|
|
6
|
|
7
|
|
|
|
test2 : Nat
|
|
test2 = A.B.do
|
|
5
|
|
6
|
|
7
|