Skip to content

(<.>) operator (generalizing (.) to Functor)

Currently there are following operators:

(<$>) :: (a -> b) -> f a -> f b
($) :: (a -> b) -> a -> b
(.) :: (b -> c) -> (a -> b) -> a -> c

However defining the operator that is to <$> as . is to $ is trivial:

(<.>) :: (b -> c) -> (a -> f b) -> a -> f c
f <.> g = fmap f . g

It would help writing in pointless style using Functors (as well as Applicatives/Monads etc.)

Trac metadata
Trac field Value
Version 6.12.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information