
On 2002-07-30T18:43:28+0100, MR K P SCHUPKE wrote:
The data types I used are:
data (Error e) => Reply e s a= Ok [s] a | Empty | Fail e data (Error e) => Result e s a = Accepted (Reply e s a) | Rejected
newtype (Error e) => Parser e s a = Parser {runParser :: [s] -> Result e s a}
newtype (Error e,Monad m) => ParserT e s m a = ParserT {runParserT :: [s] -> m (Result e s a)}
[...]
Hope this makes things clearer...
Yes! Let me rephrase my earlier suggestion in terms of these actual types. For reasons that will soon become clear, let me begin by rearranging Result a bit: data Result x = Accepted x | Rejected newtype (Error e) => Parser e s a = Parser {runParser :: [s] -> Result (Reply e s a)} newtype (Error e, Monad m) => ParserT e s m a = ParserT {runParserT :: [s] -> m (Result (Reply e s a))} (Here I have removed the constraint "Error e" from the definition of Result. I don't think it will cause you much trouble.) Now, what about the following alternative definition of ParserT? newtype (Error e, Monad m) => ParserT e s m a = ParserT {runParserT :: [s] -> m (Result (m (Reply e s a)))} Would it suit your purposes? -- Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig When was the last time you wrote your representative in government? And, vote, for those who can't.