On Fri, 22 Jun 2007, Brandon S. Allbery KF8NH wrote:

> I have a program which I'm checking with -Wall but not -Werror,
> because it has several pattern matches which *I* know are fine but
> which ghc doesn't.  (I suspect, from its description, that Catch
> would also recognize it's fine.)  Which leads me to wonder:
>
> (1) any way to flag a pattern match as "I know this is okay", don't
> warn about it" without shutting off pattern match warnings completely?

Add the "catch all" case with '_':

f _ = error "this case cannot occur, because this would violate the invariant X"

If the error occurs anyway, you get a report that your believe was wrong.
(Or the user gets the report, and he doesn't know how to react.)

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to