You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
380 B
13 lines
380 B
7 years ago
|
# Exercises: Heavy Lifting
|
||
|
1. `a = fmap (+1) $ read "[1]" :: [Int]`
|
||
|
2. `b = (fmap . fmap) (++ "lol") (Just ["Hi,", "Hello"])`
|
||
|
3. `c = fmap (*2) (\x -> x - 2)`
|
||
|
4. `d = fmap ((return '1' ++) . show) (\x -> [x,1..3])`
|
||
|
5. see block below
|
||
|
|
||
|
```
|
||
|
e :: IO Integer
|
||
|
e = let ioi = readIO "1" :: IO Integer
|
||
|
changed = fmap read (fmap (("123"++) . show) ioi)
|
||
|
in fmap (*3) changed
|
||
|
```
|