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

Maciej Marcin Piechotka uzytkownik2 at gmail.com
Sun Aug 1 09:52:19 EDT 2010


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

a is not specialized to f a to allow such chaining:
const 1 <.> print <=< (read :: String -> Int) <.> readFile
  :: (Num t) => FilePath -> IO t

Discussion deadline: 31th August 2010

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/libraries/attachments/20100801/1ce1a49d/signature.bin


More information about the Libraries mailing list