1 {-# OPTIONS -fglasgow-exts #-}
3 module ShouldCompile where
5 -- A stripped down functional-dependency
6 -- example that causes GHC 4.08.1 to crash with:
7 -- "basicTypes/Var.lhs:194: Non-exhaustive patterns in function readMutTyVar"
8 -- Reported by Thomas Hallgren Nov 00
11 primDup :: Int -> IO Int
16 -- call :: Call c h => c -> h
18 -- call primDup :: h with {Call (Int -> IO Int) h}
19 -- Hence h must be fixed by the environment
20 -- Reduce at top level to {Call (IO Int) h'}
22 class Call c h | c -> h where
25 instance Call c h => Call (Int->c) (Int->h) where