diff options
Diffstat (limited to 'Haskell-book/16/HeavyLifting.hs')
| -rw-r--r-- | Haskell-book/16/HeavyLifting.hs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Haskell-book/16/HeavyLifting.hs b/Haskell-book/16/HeavyLifting.hs new file mode 100644 index 0000000..e92f875 --- /dev/null +++ b/Haskell-book/16/HeavyLifting.hs @@ -0,0 +1,16 @@ +module HeavyLifting where + +a = fmap (+1) $ read "[1]" :: [Int] + +b = (fmap . fmap) (++ "lol") (Just ["Hi,", "Hello"]) + +c = fmap (*2) (\x -> x - 2) + +d = + fmap ((return '1' ++) . show) + (\x -> [x, 1..3]) + +e :: IO Integer +e = let ioi = readIO "1" :: IO Integer + changed = fmap read $ fmap ("123" ++) $ fmap show ioi + in fmap (*3) changed |
