[Haskell-cafe] Help a Newbie

Matthew Morvant mmorvant at bigfatreddog.com
Fri Feb 20 15:21:37 EST 2004


I am trying (and have been for quite some time) to repair a broken Haskell
script.  I keep getting stuck on “Last generator in do {...} must be an
expression”.  I am betting that this is not uncommon.  Can someone please
help me understand?

code5 :: Parser
code5 = do 
         dd <- code3
         do ddd <- code3
         do dddd <- code3
         return "ce"

code4 :: Parser
code4 = do
                        dd <- code3
                        do dde <- code3
                                    digit
                                    ddd <- many (do digit)
                                    q <- code5
                                    return (q : "ss")


Thanks in advance for helping
Matthew


More information about the Haskell-Cafe mailing list