I'm looking for a pragma that will warn on a particular incomplete pattern. It would make the compiler fail with the following (hypothetical) code:
{-# FAILIF incomplete-patterns #-}
f :: Int -> Int
f 0 = 0
I am trying to write a "compiler" using Arrows, and knowing pattern matching is complete would help isolate bugs. Thanks!
You can require warnings, including incomplete patterns, with
-Wall
:Yielding:
Or more specifically, with
-fwarn-incomplete-patterns
inplace of-Wall
.There's nothing that will work on a per-expression basis: you're currently restricted to a per-module basis.