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

Maciej Marcin Piechotka uzytkownik2 at gmail.com
Tue Aug 3 06:08:29 EDT 2010


On 03/08/10 07:11, wren ng thornton wrote:
> Maciej Marcin Piechotka wrote:
>>
>> The "a <$> b <$> c <$> d" was done to show the relation between $/. and
>> <$>/<.>.
> 
> Yes, but (.) _is_ (<$>) for (a->). Therefore, trying to make (.) and ($)
> opposing conceptions and then extending it to (<.>) and (<$>) doesn't
> necessarily make sense.
> 

I'm not sure I quite follow. I haven't stated that ($) and (.) are
opposite - I stated they are connected.

You may say that <.> is <$> for Compose ((->) a) f without the newtype &
co.

> Personally, I think being explicit about the use of fmap here makes code
> a lot clearer overall. One prime example has already been raised where
> it makes it clear that (fmap f . fmap g . h) should be written (fmap(f .
> g) . h) instead. This isn't a case like (<=<) or (<<<) where we are
> actually generalizing composition in Hask to composition in another
> category. I'm not a big fan of making a composition operator that
> crosses between categories; it just doesn't feel like a clean
> abstraction.


For existing examples of such mixture:

> (^<<) :: (Arrow a) => (c -> d) -> a b c -> a b d
> (<<^) :: (Arrow a) => a c d -> (b -> c) -> a b d
> (>>^) :: (Arrow a) => a b c -> (c -> d) -> a b d
> (^>>) :: (Arrow a) => (b -> c) -> a c d -> a b d

Regards


-------------- 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/20100803/b7575ee9/signature.bin


More information about the Libraries mailing list