Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/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: Re: WWAAA... I hate monads (Daniel Carrera)
2. parser comparison question (Walck, Scott)
3. Re: Re: WWAAA... I hate monads (Joel Neely)
----------------------------------------------------------------------
Message: 1
Date: Fri, 24 Apr 2009 22:50:28 +0200
From: Daniel Carrera <[email protected]>
Subject: Re: [Haskell-beginners] Re: WWAAA... I hate monads
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed
Ertugrul Soeylemez wrote:
> Actually Schrödinger's cat is neither dead nor alive. Its state S is a
> unit vector living in a Hilbert space.
I spoke imprecisely, but I do know about superposition. I took a couple
of quantum courses when I got my physics degree (but generally I focused
on astrophysics which is far more interesting than quantum mechanics).
Daniel.
------------------------------
Message: 2
Date: Fri, 24 Apr 2009 22:31:29 -0400
From: "Walck, Scott" <[email protected]>
Subject: [Haskell-beginners] parser comparison question
To: "[email protected]" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
I've been comparing Graham Hutton's simple parser with Parsec. Here is some
example code.
-- Comparison of Hutton's simple parser with Parsec
-- Hutton's simple parser is available at
-- http://www.cs.nott.ac.uk/~gmh/Parsing.lhs
-- Hutton simple parser called H
-- Parsec called P
import qualified Parsing as H
import qualified Text.ParserCombinators.Parsec as P
exH = H.parse (H.string "hi") "hiho"
exP = P.parse (P.string "hi") "" "hiho"
charH = H.parse (H.char 'a' H.+++ H.char 'b') "bbb"
charP = P.parse (P.char 'a' P.<|> P.char 'b') "" "bbb"
choiceH = H.parse (H.string "hoo" H.+++ H.string "ho") "hono"
choiceP1 = P.parse (P.string "bb" P.<|> P.string "ba") "" "bbb"
choiceP2 = P.parse (P.string "ba" P.<|> P.string "bb") "" "bbb"
choiceP22 = P.parse (P.try (P.string "ba") P.<|> P.string "bb") "" "bbc"
I am interested if anyone could comment on the design of the Parsec 'try'
function.
For example, choiceP2 fails and returns Left error, while choiceP22 succeeds.
Hutton's simple parser doesn't need try. It seems so simple and elegant.
I'm wondering why Parsec requires me to use 'try' for a string parse that might
fail.
Thanks,
Scott
Scott N. Walck
Associate Professor of Physics
Lebanon Valley College
------------------------------
Message: 3
Date: Fri, 24 Apr 2009 22:17:35 -0500
From: Joel Neely <[email protected]>
Subject: Re: [Haskell-beginners] Re: WWAAA... I hate monads
To: [email protected], [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
With Ertugrul's permission, I've done a simple print-to-PDF of his
"Understanding Haskell Monads" tutorial, and am providing the PDF file
to this list.
-jn-
On Fri, Apr 24, 2009 at 5:11 AM, <[email protected]> wrote:
> On Thu, Apr 23, 2009 at 09:42:56PM +0200, Ertugrul Soeylemez wrote:
>> Hello people,
>>
>> thanks for all your positive comments about my tutorial, both here and
>> through direct email. I appreciate that very much. =)
>>
>> I'm glad that my work is helpful to the community.
>
> Would you provide a PDF version along with the HTML version?
>
> Regards,
>
> Romildo
>
>> Colin Paul Adams <[email protected]> wrote:
>>
>> > >>>>> "Daniel" == Daniel Carrera <[email protected]> writes:
>> >
>> > Daniel> Sam Martin wrote:
>> > >>> This is excellent:
>> > >>>
>> > >>> http://ertes.de/articles/monads.html
>> > >>
>> > >> Wow. That really is a great tutorial! Suddenly the world
>> > >> becomes clear...
>> > >>
>> > >> Definitely gets my vote as must read material.
>> >
>> > Daniel> +1
>> >
>> > Daniel> I was very impressed too. And I am not easy to impress
>> > Daniel> when it comes to documentation. I plan to read it a second
>> > Daniel> time to solidify some of the ideas, but on my first
>> > Daniel> reading my understanding of Monads increased by leaps and
>> > Daniel> bounds.
>> >
>> > Daniel> Ertugrul deserves to be commended, and this tutorial
>> > Daniel> should be made more prominent on haskell.org.
>> >
>> > I think so.
>> > I've read VERY MANY tutorials on monads, and they were all confusing -
>> > except this one.
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
--
Beauty of style and harmony and grace and good rhythm depend on
simplicity. - Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Understanding Haskell Monads.pdf
Type: application/pdf
Size: 257719 bytes
Desc: not available
Url :
http://www.haskell.org/pipermail/beginners/attachments/20090424/5476cc76/UnderstandingHaskellMonads.pdf
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 10, Issue 28
*****************************************