summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc231.hs
blob: 9d0fc8316ba72416fec23c4217b9a5545b3e23a0 (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 -dsuppress-module-prefixes #-}
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts #-}

-- See #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)