module Case(module Case) wheremain :: IO ()main = do print $ f1 False print $ f2 False print $ f2 True-- printInt $ f3 False print $ map f4 [R,G,B] print $ f5 [(3::Int,4::Int)] --printInt $ f6 [(3,4)] print $ [ i | Just i <- [Just (1::Int), Nothing, Just 2] ] (x,y) <- return (2::Int,3::Int) print $ x + yf1 :: Bool -> Boolf1 b = case b of c -> cf2 :: Bool -> Intf2 b = case b of True -> 1 _ -> 0f3 :: Bool -> Intf3 b = case b of True -> 1data RGB = R | G | Binstance Show RGB where show = showRGBshowRGB :: RGB -> StringshowRGB c = case c of R -> "R" G -> "G" B -> "B"nextRGB :: RGB -> RGBnextRGB c = case c of R -> G G -> B B -> Rf4 :: RGB -> RGBf4 c = case nextRGB c of R -> R k -> nextRGB kf5 :: [(Int, Int)] -> Intf5 arg = case arg of [] -> 0 (x,y) : _ -> x+y{-f6 :: [(Int, Int)] -> Intf6 arg = case arg of [] -> 0 (x,y) : ((u,v) : _) -> x+y-}