~jojo/Carth

bc0644a86e6245f1f2f59070836318845eceb147 — JoJo 1 year, 1 month ago ebf21d4
std: Add io/then{l,r}. Same as {<<,>>} in Haskell
1 files changed, 3 insertions(+), 0 deletions(-)

M std/io.carth
M std/io.carth => std/io.carth +3 -0
@@ 19,6 19,9 @@

(define io/bindr (flip io/bind))

(define (io/thenl mb ma) (io/bind (const mb) ma))
(define (io/thenr ma mb) (io/bindr ma (const mb)))

(define: (unsafe-perform-io ma)
    (forall (a) (Fun (IO a) a))
  (car (perform-io ma UnsafeRealWorld)))