X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=_rosetta2.mdwn;h=d4236095de317ee74616f40136958c8718f32dfa;hp=48ac277568b596ca2db87c993fe34dcabe32c8f3;hb=8b5f17b3b2c71d443362d7f629dec6cd82b4fb59;hpb=3c658e4d9ed21aaa5d5655bcca002c8c76da4348 diff --git a/_rosetta2.mdwn b/_rosetta2.mdwn index 48ac2775..d4236095 100644 --- a/_rosetta2.mdwn +++ b/_rosetta2.mdwn @@ -463,7 +463,7 @@ The syntax for declaring and using these is a little bit different in the two la type color = Color of (int * int * int);; let c = Color (0, 127, 255);; - + and then extract the field you want using pattern-matching: let Color (r, _, _) = c;; @@ -717,13 +717,13 @@ Haskell has more built-in support for monads, but one can define the monads one main = do let s = "hello world" putStrLn s - + main :: IO String main = do let s = "hello world" putStrLn s return s - + main :: IO String main = let s = "hello world" in putStrLn s >> return s