Re: [Haskell-cafe] i am missing something really trivial with parsec

2009-09-30 Thread Brent Yorgey
On Tue, Sep 29, 2009 at 12:54:21AM -0700, Anatoly Yakovenko wrote: number = do { num - natural ; return $ num } main = do txt - hGetContents stdin print $ parse number stdin txt why doesn't that work? Could you be a little more specific? What are you

[Haskell-cafe] i am missing something really trivial with parsec

2009-09-29 Thread Anatoly Yakovenko
number = do { num - natural ; return $ num } main = do txt - hGetContents stdin print $ parse number stdin txt why doesn't that work? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] i am missing something really trivial with parsec

2009-09-29 Thread Ryan Ingram
I don't know, but: number -- definition = do { num - natural ; return $ num } -- desugar = natural = \num - return $ num -- apply ($) = natural = \num - return num -- eta elimination (f == \x - f x) = natural = return -- monad law = natural (modulo monomorphism restriction, since number doesn't