summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc109.hs
blob: 0d9fdc051ca14dadcfd4019d060a7abec0294fa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
             UndecidableInstances #-}
-- UndecidableInstances because 'b' appears in the context but not the head

module ShouldCompile where

-- This accepted by Hugs, but not by GHC 4.08.1
-- Reported by Thomas Hallgren Nov 00

class P a
class R a b | b->a

instance (P a,R a b) => P [b]

{- GHC 4.08.1 doesn't seem to allow variables in the context that
don't appear after the =>, but which are still ok since they are
determined by the functional dependenices.  -}