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
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
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