summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc109.hs
blob: 2a08caea08b2f766cb2c50beeb1f429a496ff11c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# 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.  -}