git.iko.soy/rowtype-yoga/purescript-native
on 558cd4e help sign in
19 lines 417 B history raw
1foreign import data IO :: * -> *
3foreign import ret :: forall a. a -> IO a
5foreign import (>>=) :: forall a b. IO a -> (a -> IO b) -> IO b
7(*>) = \a -> \b -> a >>= \x -> b
9foreign import putStrLn :: String -> IO {}
11replicateM_ :: forall a. Number -> IO a -> IO {}
12replicateM_ = \n -> \x -> do
13 var io = ret {}
14 for i <- 0 until n:
15 io = x *> io
16 return io
18main = replicateM_ 10 (putStrLn "Hello World!")