#4189: Add (<.>) operator (generalizing (.) to Functor)

Ross Paterson ross at soi.city.ac.uk
Mon Aug 2 13:03:16 EDT 2010


On Mon, Aug 02, 2010 at 10:52:21AM -0400, David Menendez wrote:
> On Sun, Aug 1, 2010 at 9:52 AM, Maciej Marcin Piechotka
> <uzytkownik2 at gmail.com> wrote:
> > 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
> 
> 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".

I think that's a convincing argument against.  The proposed operator
doesn't save much typing, but you need to remember new laws to use
it effectively.


More information about the Libraries mailing list