[Haskell-cafe] Pattern match failure, then inconsistent function
Malcolm.Wallace at cs.york.ac.uk
Tue Aug 23 06:46:06 EDT 2005
Adam Wyner <adam at wyner.info> writes:
> I am getting a "pattern match failure", and then subsequent functions
> which worked right work wrong. I am using Hugs and Trex.
The problem with subsequent evaluations is simple. When Hugs says this:
> INTERNAL ERROR: Error in graph
it means that the whole internal evaluation context has become
corrupted. Any further use of the reduction graph (representing the
program) is likely to give wrong answers. Reloading the program code
wipes the internal graph and starts again. Normally, when someone
gets an error message (like "pattern-match failure"), they go and
fix the program immediately, then reload, which is why few people
complain about the cascading-errors behaviour.
> Program error: pattern match failure: map_v780 (instEq_v20 instEq_v11
> Eq_== "neg-prop2") map_v780
The pattern-match failure seems to be in an expression looking
map (== "neg-prop2") xs
and I think the problem is possibly in an "instance Eq" you have written
by hand for one of your datatypes. "Pattern-match failure" means that you
have not covered all the possible patterns in your definition. This might
either be on the LHS of the defn, or in a case expression on the RHS.
More information about the Haskell-Cafe