September 2017
Beginner to intermediate
396 pages
9h 46m
English
data Product1 = Product1 Bool deriving Show data Product2 = Product2 Bool Bool deriving Show data Product3 a = Product3 a Bool deriving Show data Product4 a b = Product4 a b deriving Show
main :: IO () main = do putStrLn "Product1: Simple product type" putStrLn $ show $ Product1 True putStrLn $ show $ Product1 False putStrLn "Product2: Product type with two fields" putStrLn "Product2 has two boolean fields. Each one can take two values each" putStrLn $ show $ Product2 True True putStrLn $ show $ Product2 True False putStrLn ...
Read now
Unlock full access