Haskell coding-style: map, fmap or ?

As you say, map is a less general form of fmap. If you know you have a list then I would use map as it makes the code clearer and if you make a mistake the error message is likely to be less confusing. However to a large extent it’s a matter of preference.

(<$>) is the same as fmap. Until GHC 7.10 it wasn’t exported by the Prelude so wasn’t available by default – but even with older GHC versions it’s easy to import from Data.Functor or Control.Applicative and these days it’s pretty much the standard way to do this.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)