[Haskell-beginners] pure instead of return?

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


btw: does the name of "pure" come from the idea that the monad IO is
"impure" (which does not seem to be the case, does it?) or is it more of a
mathematical concept of pure values vs values whose types are
functors/applicatives/monads? or is it a way to say "simplest way to wrap
the value, purest (least "modified") equivalent of the value as wrapped
value"?

2017-07-01 15:09 GMT+02:00 Silent Leaf <silent.leaf0 at gmail.com>:

> hi,
>
> i just wanted to know, if i use pure instead of return, if there's any
> single risk of getting a different implementation of the function, or
> anything of that kind. also, am i right to assume that GHC will do what is
> needed so there's no actual redirection in the compiled code, in the case
> pure is defined in terms of return?
>
> thanks
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170701/760b39d9/attachment.html>


More information about the Beginners mailing list