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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…