On Sun, Mar 20, 2005 at 03:32:38PM -0500, Dimitry Golubovsky wrote:
> type TParser a = GenParser Token (FiniteMap String Declaration) a
>> The FiniteMap (which is the user state) is expected to be updated during
> parsing whus building some internal lookup table.
>> and in one of the parsing functions I want to call
>> show getState
>> assuming it will apply show to the FiniteMap and return some string of
> characters.
>> During compliation, I get:
>> No instance for (Show (GenParser tok st st))
> arising from use of `show' at (file location)
> In the first argument of `xxxx', namely `(show getState)'
This is a good clue--you don't want to show a parser, you want to show
the state. Look at the type of getState and think monadic thoughts.
There is in fact an example of its use in the Parsec documentation.
Andrew