Re[2]: [Haskell-cafe] Re: Parsers are monadic?

2007-07-03 Thread Bulat Ziganshin
Hello Gregory, Tuesday, July 3, 2007, 1:02:44 AM, you wrote: Right, I read more about it and found this out.  The 'main' function is apparently magical at runtime and allows you to break i recommend you to read two htmls:

Re: [Haskell-cafe] Re: Parsers are monadic?

2007-07-02 Thread Jules Bean
Gregory Propf wrote: Thanks, that was helpful. I didn't realize that there were pure functional monads. Actually, it's stronger than that. All monads are pure functional, even IO. Haskell is an entirely 100% pure functional language[*]. The IO monad allows you to build up, in a pure,

[Haskell-cafe] Re: Parsers are monadic?

2007-07-02 Thread apfelmus
Paul Hudak wrote: readFile :: Name - FailCont - StrCont - Behaviour Here StrCont was the success continuation, which took a string (the file contents) as argument. I rather liked the flexibility that this offered -- since I/O errors were fairly common, it made sense to give success and

Re: [Haskell-cafe] Re: Parsers are monadic?

2007-07-02 Thread Claus Reinke
class Monad m = MonadError e m | m - e where throwError :: e - m a catchError :: m a - (e - m a) - m a .. power of TwoCont? I mean, it still seems like there's an operation missing that supplies new left and right continuations at once. i guess, instead of one DiMonad with two sets of

[Haskell-cafe] Re: Parsers are monadic?

2007-07-02 Thread apfelmus
apfelmus wrote: class DiMonad m where returnR :: a - m e a bindR :: m e a - (a - m e b) - m e b returnL :: e - m e a bindL :: m e a - (e - m e' a) - m e' a type TwoCont e a = (e - R) - (a - R) - R A final question remains: does the dimonad abstraction cover the

Re: [Haskell-cafe] Re: Parsers are monadic?

2007-07-02 Thread Gregory Propf
[EMAIL PROTECTED] To: Gregory Propf [EMAIL PROTECTED] Cc: haskell-cafe@haskell.org Sent: Monday, July 2, 2007 1:40:09 AM Subject: Re: [Haskell-cafe] Re: Parsers are monadic? Gregory Propf wrote: Thanks, that was helpful. I didn't realize that there were pure functional monads. Actually, it's

[Haskell-cafe] Re: Parsers are monadic?

2007-07-02 Thread Arie Peterson
Gregory Propf wrote: Right, I read more about it and found this out. The 'main' function is apparently magical at runtime and allows you to break the with pure functionality just once but since it can call other functions this allows for useful programs to be written. There is more than one

Re: [Haskell-cafe] Re: Parsers are monadic?

2007-07-01 Thread Alexis Hazell
On Sunday 01 July 2007 09:34, Gregory Propf wrote: Thanks, that was helpful. I didn't realize that there were pure functional monads. Neither did i; the general impression i'd got after almost a year of trying to learn Haskell was: Monad Eisley Spaceport. You will never find a more wretched

[Haskell-cafe] Re: Parsers are monadic?

2007-06-30 Thread Eric
Gregory Propf gregorypropf at yahoo.com writes: First post. I'm a newbie, been using Haskell for about a week and love it. Anyway, this is something I don't understand. Parsers are monadic. I can see this if the parser is reading from an input stream but if there's just a block of text can't

[Haskell-cafe] Re: Parsers are monadic?

2007-06-30 Thread Eric
Eric devnull1999 at yahoo.com writes: Looks as if others may be answering questions you didn't ask. I should read more carefully before posting: Big Chris did answer your question, though phrased differently than I did. --Eric ___ Haskell-Cafe

Re: [Haskell-cafe] Re: Parsers are monadic?

2007-06-30 Thread Gregory Propf
Thanks, that was helpful. I didn't realize that there were pure functional monads. -- Monadic just means a calculation using a mathematical structure called a monad. All impure calculations in Haskell are monadic, but not all monadic