Modify the Parser monad to admit arbitrary lookahead.
Hint: use the following definition of Parser, which
explicitly represents lookahead errors rather than using the
builtin error-handling mechanism.
type Parser a =
Handle -> [Token] ->
IO ([Token], Maybe (a, [Token]))
If such a parser is run on a handle h with lookahead toks,
it returns pair (toks1,m) where toks1 is
the new lookahead, and m is either Nothing if the parse
has failed or Just (x,toks2) if the parse was successful.
In the latter case, x is the result of the parse and toks2
is the list of tokens accepted.