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;;
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