Usage of `pure`

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Usage of `pure`

Paul
Hello, Dear Cafe!

Consider, I have big application with monad and applicative related
code. What problems I can hit if I will replace all `return`s with
`pure` (in `do`-blocks, anywhere). So, `return` will be totally eliminated.

===

Best regards, Paul

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Usage of `pure`

Francesco Ariis
On Thu, Jun 07, 2018 at 02:21:09PM +0300, PY wrote:
> Consider, I have big application with monad and applicative related code.
> What problems I can hit if I will replace all `return`s with `pure` (in
> `do`-blocks, anywhere). So, `return` will be totally eliminated.

Hello Paul,
    that might be a problem only if you need to support the (very very
old) GHC 7.8 (or previous versions)
-F
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Usage of `pure`

Haskell - Haskell-Cafe mailing list
In reply to this post by Paul
Hi Paul,

in case you're using -Wredundant-constraints, you might get some
warnings that a function that previously required Monad, now only
requires Applicative.

Cheers,
Simon

2018-06-07 13:21 GMT+02:00 PY <[hidden email]>:

> Hello, Dear Cafe!
>
> Consider, I have big application with monad and applicative related code.
> What problems I can hit if I will replace all `return`s with `pure` (in
> `do`-blocks, anywhere). So, `return` will be totally eliminated.
>
> ===
>
> Best regards, Paul
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.