[Haskell-beginners] pure instead of return?

Stefan Risberg steffenomak at gmail.com
Sat Jul 1 19:46:45 UTC 2017


Every monad is applicative, but every instance of applicative does not have
a monad one

On 1 Jul. 2017 20:19, "Silent Leaf" <silent.leaf0 at gmail.com> wrote:

> but i can use pure every time return is usable, can i not? every
> applicatives are monads right? i don't get the "if you can" part. why could
> i not?
>
> 2017-07-01 20:03 GMT+02:00 Francesco Ariis <fa-ml at ariis.it>:
>
>> On Sat, Jul 01, 2017 at 07:47:57PM +0200, Silent Leaf wrote:
>> > [..] or is it a way to say "simplest way to wrap
>> > the value, purest (least "modified") equivalent of the value as wrapped
>> > value"?
>>
>> ^-- this one.
>>
>> `pure` and `return` are synonyms. There are two words for the same concept
>> for historical reasons. Using pure does not incurs in monad constraints,
>> so if you can you might want to use that.
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170701/7357c493/attachment.html>


More information about the Beginners mailing list