Brian Hulley wrote:
translate :: (Monad m) => String -> m String
translate = do
                      createParseContext
                      readToFirstIdentifier
                      dealWithDeclarator
                      consolidateOutput

The type signature above doesn't match the do block. It would either have to be changed to something like:

translate :: Control.Monad.State.MonadState String m => m ()

(storing the string in the monad's state instead of using a monad which returns it) or the do block could be replaced with the >>= operator as below, to thread the returned string between the components of the "pipe":

translate :: Monad m => String -> m String
translate x =
                     return x >>=
                     createParseContext >>=
                     readToFirstIdentifier >>=
                    dealWithDeclarator >>=
                    consolidateOutput

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to