Adding (??) into Data.Functor

Daniil Frumin difrumin at gmail.com
Mon Feb 17 18:08:03 UTC 2014


Oh, I forgot about the effect order,
sorry for hijacking the thread.

On Mon, Feb 17, 2014 at 8:43 PM, Twan van Laarhoven <twanvl at gmail.com> wrote:
> 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



-- 
Sincerely yours,
-- Daniil


More information about the Libraries mailing list