Send Beginners mailing list submissions to
[email protected]
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
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. pure instead of return? (Silent Leaf)
2. Re: pure instead of return? (Silent Leaf)
3. Re: pure instead of return? (Francesco Ariis)
4. Re: pure instead of return? (Silent Leaf)
5. Re: pure instead of return? (Stefan Risberg)
6. Re: pure instead of return? (Silent Leaf)
----------------------------------------------------------------------
Message: 1
Date: Sat, 1 Jul 2017 15:09:31 +0200
From: Silent Leaf <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] pure instead of return?
Message-ID:
<cagfccjonvqsrmvy_aq2nf_na6a9db-+v397jcbjz8n60x6f...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
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/a8b929ad/attachment-0001.html>
------------------------------
Message: 2
Date: Sat, 1 Jul 2017 19:47:57 +0200
From: Silent Leaf <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] pure instead of return?
Message-ID:
<cagfccjopuxuru2oqtprfxez8zdr9m9mkv6oqryhybfot6_f...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
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 <[email protected]>:
> 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-0001.html>
------------------------------
Message: 3
Date: Sat, 1 Jul 2017 20:03:30 +0200
From: Francesco Ariis <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] pure instead of return?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
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.
------------------------------
Message: 4
Date: Sat, 1 Jul 2017 20:18:57 +0200
From: Silent Leaf <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] pure instead of return?
Message-ID:
<CAGFccjODc1ZChQ7Tm_8Chds+-zxwqwiWQd30oy_ku=ldr7t...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
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 <[email protected]>:
> 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
> [email protected]
> 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-0001.html>
------------------------------
Message: 5
Date: Sat, 1 Jul 2017 21:46:45 +0200
From: Stefan Risberg <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] pure instead of return?
Message-ID:
<cajyenbmcqx9c4m5ztvuuvhwzgkcw60xxaj_hwgeqcgwu-o1...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Every monad is applicative, but every instance of applicative does not have
a monad one
On 1 Jul. 2017 20:19, "Silent Leaf" <[email protected]> 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 <[email protected]>:
>
>> 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
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> 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-0001.html>
------------------------------
Message: 6
Date: Sat, 1 Jul 2017 21:54:17 +0200
From: Silent Leaf <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] pure instead of return?
Message-ID:
<cagfccjoemzn_yvb8sryeh0b_seygi0g-lfnwratkalflrec...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
yeah i know, so why did you say "so if you can you might want to use that"?
2017-07-01 21:46 GMT+02:00 Stefan Risberg <[email protected]>:
> Every monad is applicative, but every instance of applicative does not
> have a monad one
>
> On 1 Jul. 2017 20:19, "Silent Leaf" <[email protected]> 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 <[email protected]>:
>>
>>> 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
>>> [email protected]
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
> _______________________________________________
> Beginners mailing list
> [email protected]
> 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/9039b390/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 109, Issue 1
*****************************************