
10 Dec
2006
10 Dec
'06
4:53 a.m.
On Sun, Dec 10, 2006 at 10:46:37AM +0100, Waldemar Biernacki wrote:
Thank you all of you,
your remarks and commants are very useful for me. I'm starting to studying Haskell!
My first comparison to (my preferred) Perl is to show file on the screen:
The Code in Haskell:
===================== import System main=do [ f ] <- getArgs s <- readFile f putStr s =====================
is more readable but a longer than that in Perl:
===================== open f, "<$ARGV[0]"; while ( <f> ) { print } =====================
import System;main=getArgs>>=readFile.head>>=putStr * Do notation has been reduced to monadic combinators * Layout rule is not used