Hello,
I am a somewhat experienced programmer and a complete Haskell newbie, so I
hope this is the correct ML for my question.
I have decided to learn Haskell and started with Graham Hutton's book.
Everything was going nicely until section 8.4, on sequencing functional
parsers. I am trying to w
On 6/4/07, Juozas Gaigalas <[EMAIL PROTECTED]> wrote:
Hello,
I am a somewhat experienced programmer and a complete Haskell newbie, so I
hope this is the correct ML for my question.
I have decided to learn Haskell and started with Graham Hutton's book.
Everything was going nicely until section
On 04/06/07, Alfonso Acosta <[EMAIL PROTECTED]> wrote:
Hugs is probably complaining because it identifies "x <- item" (which
is not a simple expression) as the last element of do.
That was my first guess, too, but it's not the case, switch to a
monospaced font to see this.
Juozas, you could on
Hi Juozas,
> -
>
> type Parser a = String -> [(a, String)]
>
> return :: a -> Parser a
> return v = \inp -> [(v, inp)]
>
> failure :: Parser a
> failure = \inp -> []
>
>
> item :: Parser Char
> item = \inp -> case inp of
> [] -> []
> (x:xs) -
David House wrote:
Juozas, you could only use do-notation if your Parser type were
declared an instance of the Haskell type-class Monad. Seeing as you
haven't done this, you have to stick to the "de-sugared" version
involving (>>=) and return:
Is this true? I thought do (like all sugar) was des
Dan Weston wrote:
Is this true? I thought do (like all sugar) was desugared before
semantic analysis. So long as you have the right >>=, return, and fail
in scope, I would have thought the desugaring is oblivious to their
definition (and particularly ignorant of instancing of the Monad
typecla
On Mon, Jun 04, 2007 at 05:42:35PM +0300, Juozas Gaigalas wrote:
> Hello,
>
> I am a somewhat experienced programmer and a complete Haskell newbie, so I
> hope this is the correct ML for my question.
>
> I have decided to learn Haskell and started with Graham Hutton's book.
> Everything was goin