c60aa85406463ea3614a1c04223fd6004c2ca719
[ghc.git] / testsuite / tests / typecheck / should_compile / tc201.hs
1 {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
2 ExistentialQuantification, FlexibleContexts #-}
3
4 {- Email 30 Jan 2006
5
6 > the attached program compiles under GHC, but not with Hugs. as far as
7 > i see, Hugs don't use dependencies in class headers to figure out that
8 > there is only one "vMkIOError" that can be called in the last
9 > definition
10
11 OK, I think it's a bug (though the example is bizarre). Sadly Hugs's
12 support for FDs is rough around the edges (and unlikely to improve
13 soon).
14
15 -}
16
17 module ShoudlCompile where
18
19 class (Monad m) => Stream m h | h->m where
20 vMkIOError :: h -> Int
21
22 data BinHandle = forall h . Stream IO h => BinH h
23
24 instance Stream IO BinHandle where
25 vMkIOError (BinH h) = vMkIOError h