Option型
compute :: Maybe Int -> String compute = foldl (\_ x -> "The value is: " ++ show x) "No value" main :: IO () main = do let full = Just 42 let empty = Nothing putStrLn $ "compute full -> " ++ compute full putStrLn $ "compute empty -> " ++ compute empty