blob: 4739626fa5c1799b89ffd8497daec91b37706575 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
module T7220a where
class C a b | b -> a
data X = X
data Y = Y
type family TF b
f :: (forall b. (C a b, TF b ~ Y) => b) -> X
-- This type is really ambiguous
-- GHC 7.8 didn't detect that, and accepted the type, but would fail
-- when given g :: <the same type>
-- g x = f x
-- But it would succeed if you said just
-- g = f
-- Now we fail in all ways!
f _ = undefined
|