Hello, world!
Posted feedbacks - Clean
1 2 3 4 5 6 7 8 9 | // hello.icl
module hello
import StdEnv
($) infixr 1
($) a b :== a b
(>>=) infixl 0
(>>=) a b = \ w -> (\ (x, w) -> b x w ) $ a w
liftM m :== \ lst -> \ w -> (m lst, w)
Start w = snd ((stdio >>= liftM (fwrites "Hello World!\n") >>= fclose) w)
|
よりhaskell風に
1 2 3 | module hello
import StdEnv;($) infixr 1;($) a b :== a b;(>>.) infixl 0;(>>.) a b = \ w -> (\ (_, w) -> b w) (a w);(>>=) infixl 0;(>>=) a b = \ w -> (\ (x, w) -> b x w ) (a w);liftM m :== \ lst -> \ w -> (m lst, w);join del [x:xs]= (toString x) +++ del +++ (join del xs);join _ [] = "";putStr str = \w -> (stdio >>= liftM ( fwrites str) >>= fclose) w;Start w =snd $ main w;
main = putStr "Hello," >>. putStr " World!\n"
|



にしお
#3358()
Rating0/0=0.00
[ reply ]