
21 Feb
2004
21 Feb
'04
6:57 p.m.
Matthew, The last parts of your two do statements read 'return "Suc"': code3 = do { ... ; return "Suc" } +++ do { ... ; return "Suc" } . Assuming that (+++) :: forall a . Parser a -> Parser a -> Parser a the type for code3 will be inferenced as code3 :: Parser [Char] . You annotated code3 as follows: code3 :: b -> [Char] .
From this we would deduce
type Parser a = forall b . b -> a . However, then you would not have been able to declare Parser an instance of Monad. So, I think you should just change the type annotation on code3. ;) HTH, Stefan