Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  can I use "pure" all the time instead of "return" now?
      (Silent Leaf)
   2. Re:  can I use "pure" all the time instead of "return" now?
      (David Thomas)
   3. Re:  can I use "pure" all the time instead of "return" now?
      (Theodore Lief Gannon)
   4. Re:  can I use "pure" all the time instead of "return" now?
      (Marcin Mrotek)


----------------------------------------------------------------------

Message: 1
Date: Sat, 14 May 2016 23:39:36 +0200
From: Silent Leaf <silent.le...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: [Haskell-beginners] can I use "pure" all the time instead of
        "return" now?
Message-ID:
        <CAGFccjM60jWOsAfKB6gm9TA9d=yccxb2ymouuxwha-ogu6e...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

All in the title; Since the change in GHC, 7.10 i think, where all Monad
instances had to have Applicative instances too, in theory all monads must
have a pure method that should be identical to return, right?

My subjectively superficial reason for preferring pure (and caring about
the issue in the first place) is twofold: shorter (i know, i know, still
the shorter, the quicker to read and then understand in the code) and,
mostly, less semantically-awkward --honestly the name "stains" the
functional semantics in Monadic code, in my opinion, but that's just
personal. (For those who know, it feels like the "new" operator in JS (OO
class-instanciation semantical imitation))

Of course now I'm perfectly used to, have no trouble seeing it for what it
is all the time, not mixing it up with some imperative-like "return"
concept.
Yet i don't really like it much at all, so I wanted to know to which extent
it is safe to always use pure even in explicitly Monadic contexts.

Thankx in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20160514/811a8f29/attachment-0001.html>

------------------------------

Message: 2
Date: Sat, 14 May 2016 14:54:22 -0700
From: David Thomas <davidleotho...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] can I use "pure" all the time instead
        of "return" now?
Message-ID:
        <cajudvcg-qbzmjduyzeu3z2esjrf-b-8savhk7jjq0owu9og...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

As I understand it, that's correct - you can use pure anywhere you'd
have used return.

On Sat, May 14, 2016 at 2:39 PM, Silent Leaf <silent.le...@gmail.com> wrote:
> All in the title; Since the change in GHC, 7.10 i think, where all Monad
> instances had to have Applicative instances too, in theory all monads must
> have a pure method that should be identical to return, right?
>
> My subjectively superficial reason for preferring pure (and caring about the
> issue in the first place) is twofold: shorter (i know, i know, still the
> shorter, the quicker to read and then understand in the code) and, mostly,
> less semantically-awkward --honestly the name "stains" the functional
> semantics in Monadic code, in my opinion, but that's just personal. (For
> those who know, it feels like the "new" operator in JS (OO
> class-instanciation semantical imitation))
>
> Of course now I'm perfectly used to, have no trouble seeing it for what it
> is all the time, not mixing it up with some imperative-like "return"
> concept.
> Yet i don't really like it much at all, so I wanted to know to which extent
> it is safe to always use pure even in explicitly Monadic contexts.
>
> Thankx in advance!
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>


------------------------------

Message: 3
Date: Sat, 14 May 2016 15:04:21 -0700
From: Theodore Lief Gannon <tan...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] can I use "pure" all the time instead
        of "return" now?
Message-ID:
        <CAJoPsuA=jZ5tu6wZQq_cTA+BB4XcPX=mtkfgs52ebsen17q...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

If/when Applicative Do drops, would using 'return' force monad semantics on
a do-block that could otherwise be applicative? That's the only thing that
comes to mind. Otherwise yeah, I've been using 'pure' exclusively for a
while.
On May 14, 2016 2:54 PM, "David Thomas" <davidleotho...@gmail.com> wrote:

> As I understand it, that's correct - you can use pure anywhere you'd
> have used return.
>
> On Sat, May 14, 2016 at 2:39 PM, Silent Leaf <silent.le...@gmail.com>
> wrote:
> > All in the title; Since the change in GHC, 7.10 i think, where all Monad
> > instances had to have Applicative instances too, in theory all monads
> must
> > have a pure method that should be identical to return, right?
> >
> > My subjectively superficial reason for preferring pure (and caring about
> the
> > issue in the first place) is twofold: shorter (i know, i know, still the
> > shorter, the quicker to read and then understand in the code) and,
> mostly,
> > less semantically-awkward --honestly the name "stains" the functional
> > semantics in Monadic code, in my opinion, but that's just personal. (For
> > those who know, it feels like the "new" operator in JS (OO
> > class-instanciation semantical imitation))
> >
> > Of course now I'm perfectly used to, have no trouble seeing it for what
> it
> > is all the time, not mixing it up with some imperative-like "return"
> > concept.
> > Yet i don't really like it much at all, so I wanted to know to which
> extent
> > it is safe to always use pure even in explicitly Monadic contexts.
> >
> > Thankx in advance!
> > _______________________________________________
> > Beginners mailing list
> > Beginners@haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >
> _______________________________________________
> Beginners mailing list
> Beginners@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/20160514/348e3e25/attachment-0001.html>

------------------------------

Message: 4
Date: Sun, 15 May 2016 10:58:46 +0200
From: Marcin Mrotek <marcin.jan.mro...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] can I use "pure" all the time instead
        of "return" now?
Message-ID:
        <CAJcfPzmv1YYw0K3=syfaatt+jgi7a2sryqzs-xw4+fbravg...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hello,

> If/when Applicative Do drops, would using 'return' force monad semantics on a 
> do-block that could otherwise be
> applicative? That's the only thing that comes to mind. Otherwise yeah, I've 
> been using 'pure' exclusively for a while.

 I think so, at least until the "Monad of no return" proposal
(https://ghc.haskell.org/trac/ghc/wiki/Proposal/MonadOfNoReturn)
lands.

Best regards,
Marcin Mrotek


------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 95, Issue 20
*****************************************

Reply via email to