Adding (??) into Data.Functor

Twan van Laarhoven twanvl at gmail.com
Mon Feb 17 16:43:17 UTC 2014


On 17/02/14 17:29, Daniil Frumin wrote:
> On Mon, Feb 17, 2014 at 8:21 PM, Twan van Laarhoven <twanvl at gmail.com> wrote:
>> Would (<$$>) be a sensible name? To match (<**>) from Control.Applicative
>>
>>    (<$$>) :: Functor f => a -> f (a -> b) -> f b
>>
>> I don't really feel the need for such a function, though.
>>
>>
>> On a related note, the documentation for (<**>) is pretty bad. It says "A
>> variant of <*> with the arguments reversed." but that doesn't make it clear
>> that the function is different from `flip (<*>)`.
>>
>
> Is the current definition not equivalent to `flip (<*>)` though?

It is defined as

     (<**>) = liftA2 (flip ($))

So it does not flip the order of effects.


Twan


More information about the Libraries mailing list