Commit b96db75c authored by Simon Peyton Jones's avatar Simon Peyton Jones

Refactor decideQuantification

Richard was interrogating me about decideQuantification yesterday.
I got a bit stuck on the promote_tvs part. This refactoring

 * simplifes the API of decideQuantification

 * move mkMinimalBySCs into decideQuantification (a better place for it)

 * moves promotion out of decideQuantification (where it didn't really
   fit), and comments much more fully what is going on with the promtion stuff

 * comments decideQuantification more fully

 * coments the EqPred case of quantifyPred more fully

It turned out that the theta returned by decideQuantification,
and hence by simplifyInfer, is now fully zonked, so I could remove
a zonking in TcBinds.
parent 6be91dda
......@@ -598,7 +598,7 @@ tcPolyInfer rec_tc prag_fn tc_sig_fn mono closed bind_list
; (qtvs, givens, mr_bites, ev_binds)
<- simplifyInfer tclvl mono name_taus wanted
; inferred_theta <- zonkTcThetaType (map evVarPred givens)
; let inferred_theta = map evVarPred givens
; exports <- checkNoErrs $ mapM (mkExport prag_fn qtvs inferred_theta)
mono_infos
......
This diff is collapsed.
T2693.hs:11:7:
Couldn't match expected type ‘TFn a’ with actual type ‘TFn a0’
NB: ‘TFn’ is a type function, and may not be injective
The type variable ‘a0’ is ambiguous
When checking that ‘x’ has the inferred type
x :: forall a. TFn a
Probable cause: the inferred type is ambiguous
In the expression:
do { let Just x = ...;
let n = fst x + fst x;
return () }
In an equation for ‘f’:
f = do { let Just x = ...;
let n = ...;
return () }
T2693.hs:19:15:
Couldn't match expected type ‘(a2, b0)’ with actual type ‘TFn a3’
The type variables ‘a2’, ‘b0’, ‘a3’ are ambiguous
Relevant bindings include n :: a2 (bound at T2693.hs:19:7)
In the first argument of ‘fst’, namely ‘x’
In the first argument of ‘(+)’, namely ‘fst x’
T2693.hs:19:23:
Couldn't match expected type ‘(a4, a2)’ with actual type ‘TFn a5’
The type variables ‘a2’, ‘a4’, ‘a5’ are ambiguous
Relevant bindings include n :: a2 (bound at T2693.hs:19:7)
In the first argument of ‘snd’, namely ‘x’
In the second argument of ‘(+)’, namely ‘snd x’
T2693.hs:29:20:
Couldn't match type ‘TFn a0’ with ‘PVR a1’
The type variables ‘a0’, ‘a1’ are ambiguous
Expected type: () -> Maybe (PVR a1)
Actual type: () -> Maybe (TFn a0)
In the first argument of ‘mapM’, namely ‘g’
In a stmt of a 'do' block: pvs <- mapM g undefined
T2693.hs:11:7:
Couldn't match expected type ‘TFn a’ with actual type ‘TFn a0’
NB: ‘TFn’ is a type function, and may not be injective
The type variable ‘a0’ is ambiguous
When checking that ‘x’ has the inferred type
x :: forall a. TFn a
Probable cause: the inferred type is ambiguous
In the expression:
do { let Just x = ...;
let n = fst x + fst x;
return () }
In an equation for ‘f’:
f = do { let Just x = ...;
let n = ...;
return () }
T2693.hs:19:15:
Couldn't match expected type ‘(a5, b0)’ with actual type ‘TFn a2’
The type variables ‘b0’, ‘a2’, ‘a5’ are ambiguous
Relevant bindings include n :: a5 (bound at T2693.hs:19:7)
In the first argument of ‘fst’, namely ‘x’
In the first argument of ‘(+)’, namely ‘fst x’
T2693.hs:19:23:
Couldn't match expected type ‘(a3, a5)’ with actual type ‘TFn a4’
The type variables ‘a3’, ‘a4’, ‘a5’ are ambiguous
Relevant bindings include n :: a5 (bound at T2693.hs:19:7)
In the first argument of ‘snd’, namely ‘x’
In the second argument of ‘(+)’, namely ‘snd x’
T2693.hs:29:20:
Couldn't match type ‘TFn a0’ with ‘PVR a1’
The type variables ‘a0’, ‘a1’ are ambiguous
Expected type: () -> Maybe (PVR a1)
Actual type: () -> Maybe (TFn a0)
In the first argument of ‘mapM’, namely ‘g’
In a stmt of a 'do' block: pvs <- mapM g undefined
T4921.hs:10:9:
No instance for (C a0 b1) arising from a use of ‘f’
The type variables ‘a0’, ‘b1’ are ambiguous
Relevant bindings include x :: a0 (bound at T4921.hs:10:1)
Note: there is a potential instance available:
instance C Int Char -- Defined at T4921.hs:7:10
In the first argument of ‘fst’, namely ‘f’
In the expression: fst f
In an equation for ‘x’: x = fst f
T4921.hs:12:9:
No instance for (C Int b0) arising from a use of ‘f’
The type variable ‘b0’ is ambiguous
Note: there is a potential instance available:
instance C Int Char -- Defined at T4921.hs:7:10
In the first argument of ‘fst’, namely ‘f’
In the expression: fst f :: Int
In an equation for ‘y’: y = fst f :: Int
T4921.hs:10:9:
No instance for (C a0 b1) arising from a use of ‘f’
The type variables ‘b1’, ‘a0’ are ambiguous
Relevant bindings include x :: a0 (bound at T4921.hs:10:1)
Note: there is a potential instance available:
instance C Int Char -- Defined at T4921.hs:7:10
In the first argument of ‘fst’, namely ‘f’
In the expression: fst f
In an equation for ‘x’: x = fst f
T4921.hs:12:9:
No instance for (C Int b0) arising from a use of ‘f’
The type variable ‘b0’ is ambiguous
Note: there is a potential instance available:
instance C Int Char -- Defined at T4921.hs:7:10
In the first argument of ‘fst’, namely ‘f’
In the expression: fst f :: Int
In an equation for ‘y’: y = fst f :: Int
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment