-fwarn-unused-matches
Malcolm Wallace
Malcolm.Wallace at cs.york.ac.uk
Fri Mar 28 09:36:16 EST 2003
"Serge D. Mechveliani" <mechvel at botik.ru> writes:
> ghc -c -fwarn-unused-matches
> says
> Warning: Defined but not used: x
> when compiling the function
>
> f :: Eq a => [(a, a)] -> (a, a) -> [(a, a)]
> f ps (x, y) = [(z, y) | (z, x) <- ps]
>
> Is it a bug?
No. The x on the right is in a different scope to the x on the left.
You probably intended to write:
f ps (x, y) = [(z, y) | (z, x') <- ps, x==x']
Regards,
Malcolm
More information about the Glasgow-haskell-bugs
mailing list