1 --!!! Ambiguity in local declarations
3 module ShouldSucceed where
5 type Cp a = a -> a -> Ordering
7 m :: Eq a => Cp a -> [a] -> a
8 m _ [x,y,z] = if x==y then x else z
10 cpPairs :: Cp [j] -> (a,[j]) -> (a,[j]) -> Ordering
11 cpPairs cp (_,p) (_,q) = cp p q
13 mp :: (Eq i,Eq j) => Cp [j] -> [(i,[j])] -> (i,[j])
15 let minInRow = m (cpPairs cp)
21 Ambiguous type variable(s)
22 `j' in the constraint `Eq (aYD, [j])'
23 arising from use of `m' at T.hs:24
24 In an equation for function `mp':
25 mp cp dD = let minInRow = m (cpPairs cp) in minInRow dD
27 This was because the ambiguity test in tcSimplify didn't
28 take account of the type variables free in the environment.
30 It should compile fine.