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. Re:  can I use "pure" all the time instead of "return" now?
      (Alex Belanger)
   2. Re:  can I use "pure" all the time instead of "return" now?
      (Imants Cekusins)
   3. Re:  can I use "pure" all the time instead of "return" now?
      (Alex Belanger)
   4. Re:  can I use "pure" all the time instead of "return" now?
      (Imants Cekusins)
   5. Re:  can I use "pure" all the time instead of "return" now?
      (Anton Felix Lorenzen)


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

Message: 1
Date: Mon, 16 May 2016 08:18:22 -0400
From: Alex Belanger <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] can I use "pure" all the time instead
        of "return" now?
Message-ID:
        <cadsky2y7anjokjv2mpqkrkk4fts+cwfdvp0gjupyn15fh2o...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

(%%) is a binary function.
return and pure are both unary.

I'm don't see how the infix (%%) is solving anything here.
On May 15, 2016 6:32 PM, "Imants Cekusins" <[email protected]> wrote:

> why not use  (%%) as alias for both pure and return?
>
> % - as in "investment return"
> % - as in "pure distilled ..  "
>
> :-P
> ?
>
> _______________________________________________
> 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/20160516/f41ade52/attachment-0001.html>

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

Message: 2
Date: Mon, 16 May 2016 16:19:55 +0200
From: Imants Cekusins <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] can I use "pure" all the time instead
        of "return" now?
Message-ID:
        <cap1qinaisx8qx9vn55dt6y31hgsrrlnsetwucqjvytrypfa...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

> Alex

here  is what I tried:

(%%):: Applicative f => a -> f a
(%%) = pure


test::Int -> IO Int
test i0 = (%%) $ i0 + (2::Int)


seems to work..

I can't get %% to work without ()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20160516/7b3b23bd/attachment-0001.html>

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

Message: 3
Date: Mon, 16 May 2016 10:25:14 -0400
From: Alex Belanger <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] can I use "pure" all the time instead
        of "return" now?
Message-ID:
        <CADSky2yhWqaM3O3Ag3=jhc2-lpvvkoq+sb0fg3tdj4ozxw5...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Correct, you're stuck always writing it with the parenthese because without
them; you get an infix function which is binary, not unary.

I still don't see what your solution brings new to the table in relevance
to the question. It's just trading a poorly named function for arguably an
even worse.
On May 16, 2016 10:20 AM, "Imants Cekusins" <[email protected]> wrote:

> > Alex
>
> here  is what I tried:
>
> (%%):: Applicative f => a -> f a
> (%%) = pure
>
>
> test::Int -> IO Int
> test i0 = (%%) $ i0 + (2::Int)
>
>
> seems to work..
>
> I can't get %% to work without ()
>
> _______________________________________________
> 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/20160516/1d60d029/attachment-0001.html>

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

Message: 4
Date: Mon, 16 May 2016 16:30:54 +0200
From: Imants Cekusins <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] can I use "pure" all the time instead
        of "return" now?
Message-ID:
        <cap1qinzpskm4opkte-aw1tjjf4ehaocbwkceh5lxjxsljlj...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

just an idea.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20160516/8bd0269d/attachment-0001.html>

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

Message: 5
Date: Mon, 16 May 2016 17:08:08 +0200
From: Anton Felix Lorenzen <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] can I use "pure" all the time instead
        of "return" now?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed

Of course,

it doesn't solve anything, but..

{-# LANGUAGE PostfixOperators #-}

import Control.Applicative

(%%) :: Applicative f => a -> f a
(%%) = pure

go :: IO Int
go = (12 %%)

main = do
     num <- (12 %%)
     print num


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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


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

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

Reply via email to