
18 Nov
2008
18 Nov
'08
6:54 p.m.
Many of the fmap fmaps I've seen come from (fmap f) . g = (fmap f) `fmap` g = fmap (fmap f) g = (fmap (fmap f)) g = ((fmap.fmap) f) g = (fmap.fmap) f g But... to me the former is much clearer than the latter... It is less abstract since it uses (.) instead of fmap. However, I also see (fmap.fmap.fmap), so Conal must have seen a pattern here? Of course one could also write (fmap `fmap` fmap `fmap` fmap) instead of (fmap.fmap.fmap). Or as was already mentioned with the generic replacement (.) = fmap, (fmap.fmap.fmap) can be written as ( (.) . (.) . (.) ) But besides this all being very Haskelly Hackery - and maybe ASCII art that needs to be censured - I don't see the light yet :) Could somebody enlighten me?