Applicative ((->) c) methods

Carter Schonwald carter.schonwald at gmail.com
Wed Nov 20 18:58:16 UTC 2019


Indeed. For the fucntions as reader applicative david is correct.

On Wed, Nov 20, 2019 at 1:07 AM David Feuer <david.feuer at gmail.com> wrote:

> They're not the same in general, no, but they're the same for the ((->) c)
> Applicative, which is the topic of this discussion.
>
> On Wed, Nov 20, 2019, 1:04 AM Tony Morris <tonymorris at gmail.com> wrote:
>
>> No, they are not the same function.
>>
>> λ> let (*>) = flip const in putStrLn "hi" *> putStrLn "bye"
>> bye
>> λ> let (*>) = liftA2 (flip const) in putStrLn "hi" *> putStrLn "bye"
>> hi
>> bye
>>
>> On 20/11/19 3:41 pm, David Feuer wrote:
>>
>> Both are correct.
>>
>> On Wed, Nov 20, 2019, 12:15 AM Tony Morris <tonymorris at gmail.com> wrote:
>>
>>> This is incorrect.
>>>
>>> (<*) = liftA2 const
>>> (*>) = liftA2 (flip const)
>>>
>>> On 19/11/19 6:40 am, Keith wrote:
>>> > Just thinking for Applicative ((->) c)
>>> > (<*) = const
>>> > (*>) = flip const -- or \ _ x -> x
>>> >
>>>
>>> _______________________________________________
>>> Libraries mailing list
>>> Libraries at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>>>
>> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20191120/2f8bdf89/attachment.html>


More information about the Libraries mailing list