
2 Aug
2010
2 Aug
'10
10:52 a.m.
On Sun, Aug 1, 2010 at 9:52 AM, Maciej Marcin Piechotka
The proposal is to add (<.>) function to Data.Functor/Control.Applicative: (<.>) :: (b -> c) -> (a -> f b) -> a -> f c f <.> g = fmap f . g -- (<.>) = (.) . fmap
In intend it is related to <$> in the same way as (.) is related to $: (a . b . c) d = a $ b $ c $ d (a <.> b <.> c) d = a <$> b <$> c <$> d
I'm not convinced. "fmap f . g" isn't that much longer than "f <.> g"
and requires no new combinators.
I'd argue that "fmap f . fmap g . h" is better style, since it's
obvious that this should be rewritten as "fmap (f . g) . h". In the
example above, "a <$> b <$> c <$> d" is best transformed to "a . b . c
<$> d".
--
Dave Menendez