blob: 304748994b801b120a95a7bf29554000fb5928ef (
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
28
29
|
{-# OPTIONS_GHC -ddump-types #-}
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
-- See Trac #1456
-- The key thing here is that foo should get the type
-- foo :: forall b s t1. (Zork s (Z [Char]) b)
-- => Q s (Z [Char]) t1 -> ST s ()
-- Note the quantification over 'b', which was previously
-- omitted; see Note [Important subtlety in oclose] in FunDeps
module ShouldCompile where
import GHC.ST
data Q s a chain = Node s a chain
data Z a = Z a
s :: Q t (Z [Char]) t1 -> Q t (Z [Char]) t1
s = undefined
class Zork s a b | a -> b where
huh :: Q s a chain -> ST s ()
foo b = huh (s b)
|