[Haskell-beginners] pure instead of return?

Silent Leaf silent.leaf0 at gmail.com
Sat Jul 1 18:18:57 UTC 2017


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170701/aeeb333e/attachment.html>


More information about the Beginners mailing list