Comment detail

Hello, world! (Nested Flatten)

This comment is reply for 2486 mz: (Hello, world!). Go to thread root.

より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"

Index

Feed

Other

Link

Pathtraq

loading...