Idris2/tests/idris2/basic041/QDo.idr

28 lines
375 B
Idris
Raw Normal View History

namespace MyDo
export
(>>=) : a -> (a -> IO b) -> IO b
(>>=) val k = k val
foo : IO ()
foo = MyDo.do
x <- "Silly"
putStrLn x
2020-08-30 20:52:27 +03:00
namespace A
namespace B
export
(>>=) : Nat -> (() -> Nat) -> Nat
(>>=) x fy = x + (fy ())
test : Nat
test = B.A.do
5
6
7
2020-08-30 20:52:27 +03:00
test2 : Nat
test2 = A.B.do
5
6
7