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 take any arguments
and doesn't have a type signature)

  -- ryan

On Tue, Sep 29, 2009 at 12:54 AM, Anatoly Yakovenko
<aeyakove...@gmail.com>wrote:

> 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
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to