
20 Feb
2004
20 Feb
'04
10:26 p.m.
On Fri, 20 Feb 2004 15:21:37 -0600 Matthew Morvant wrote:
I keep getting stuck on ?Last generator in do {...} must be an expression?.
'do' is for the beginning of a block. It's not needed every time a Parser is mentioned. If you want code5 to consist of 3 code3s, one after another, then you need code5 = do dd <- code3 ddd <- code3 dddd <- code3 return "something" All components of one 'do' (whether the component binds with <-, whether it's a simple expression, or it's a 'let' binding) must be indented the same amount. That is a problem on the pair of lines that mention "dde" and "digit".
code5 :: Parser code5 = do dd <- code3 do ddd <- code3 do dddd <- code3 return "ce"