The Haskell's record/struct syntax is probably the worst of any language.
C style:
a.b.c = 1;
Haskell: let b' = b a
c' = 1 + c b'
b'' = b' { c = c' }
in c' { b = b'' }It is bad, but couldn't you also write:
a { b { c = 1 } }It's (b . c .~ 1) with lens. Or a { b = (b a) { c = 1 } } without.
Now, there are two ways to use map
However, the above is equivalent to From this we see there is another way to use map Note how map was partially applied. In Haskell, map can be seen as doing two things. One is taking a function and a list, and applying the function to every element in it to produce a new list. However, you can also see map as a function transformer, taking an ordinary function, and converting it into a function that works on lists!