[nhc-bugs] Bug in pattern matching with nkpat

Ian Lynagh igloo@earth.li
Fri, 14 Sep 2001 14:54:12 +0100


Hi all

With the following code nhc98 prints 7, not 6 as I'd expect (and hugs
does).


module Main where

data Wibble = Foo | Bar

main :: IO()
main = putStrLn $ show $ foo 1 Bar

foo :: Int -> Wibble -> Int
foo (n+1) Foo = 5
foo (n+1) Bar = 6
foo _ _ = 7


Thanks
Ian