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: Parser using the show method (PICCA Frederic-Emmanuel)
2. Re: Parser using the show method (Francesco Ariis)
3. Re: Parser using the show method (Francesco Ariis)
4. Re: Parser using the show method (PICCA Frederic-Emmanuel)
----------------------------------------------------------------------
Message: 1
Date: Fri, 21 Jun 2019 13:02:26 +0000
From: PICCA Frederic-Emmanuel
<[email protected]>
To: "The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell" <[email protected]>
Subject: Re: [Haskell-beginners] Parser using the show method
Message-ID:
<a2a20ec3b8560d408356cac2fc148e53015bbbc...@sun-dag3.synchrotron-soleil.fr>
Content-Type: text/plain; charset="us-ascii"
Re-Hello,
is there a way to apply a function to all constructors of this this type ?
Instead of doing this ?
do sg P1
sg P2
sg P21
sg C2
sg P222
sg P2221
sg P21212
sg P212121
sg C222
sg C2221
sg F222
sg I222
sg I212121
sg P4
sg P41
sg P42
sg P43
sg P422
sg P4212
sg P4122
sg P41212
sg P4222
sg P42212
sg P4322
sg P43212
sg I4
sg I41
sg I422
sg I4122
sg P3
sg P31
sg P32
sg P312
sg P321
sg P3112
sg P3121
sg P3212
sg P3221
sg P6
sg P61
sg P62
sg P63
sg P64
sg P65
sg P622
sg P6122
sg P6522
sg P6222
sg P6422
sg P6322
sg R3
sg R32
sg P23
sg P213
sg P432
sg P4232
sg P4332
sg P4132
sg F23
sg F432
sg F4132
sg I23
sg I213
sg I432
sg I4132
------------------------------
Message: 2
Date: Fri, 21 Jun 2019 15:05:27 +0200
From: Francesco Ariis <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Parser using the show method
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1
On Fri, Jun 21, 2019 at 12:37:37PM +0000, PICCA Frederic-Emmanuel wrote:
> Do you know if a version existe of readMaybe with Text instead of String
Voilà
https://hackage.haskell.org/package/readable-0.3.1/docs/Data-Readable.html
Maybe is an instance of MonadPlus, so it should fit your bill
------------------------------
Message: 3
Date: Fri, 21 Jun 2019 15:08:54 +0200
From: Francesco Ariis <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Parser using the show method
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
On Fri, Jun 21, 2019 at 01:02:26PM +0000, PICCA Frederic-Emmanuel wrote:
> Re-Hello,
>
> is there a way to apply a function to all constructors of this this type ?
>
> Instead of doing this ?
>
> do sg P1
> sg P2
> sg P21
> [...]
Use the same `Enum` trick Tobias Brandt described.
λ> :t sequence_ $ map print [FirstConstructor ..]
------------------------------
Message: 4
Date: Fri, 21 Jun 2019 13:14:17 +0000
From: PICCA Frederic-Emmanuel
<[email protected]>
To: "The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell" <[email protected]>
Subject: Re: [Haskell-beginners] Parser using the show method
Message-ID:
<a2a20ec3b8560d408356cac2fc148e53015bbbc...@sun-dag3.synchrotron-soleil.fr>
Content-Type: text/plain; charset="iso-8859-7"
> Use the same `Enum` trick Tobias Brandt described.
> λ> :t sequence_ $ map print [FirstConstructor ..]
Yes, I just wanted to avoid typing all the list by hand. In order to avoid
mistake when adding new constructors later.
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 132, Issue 6
*****************************************