summaryrefslogtreecommitdiff
path: root/testsuite/tests/gadt
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-04-08 23:08:12 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-22 23:13:06 -0400
commitffde234854f49dba9ec4735aad74b30fd2deee29 (patch)
tree80409f70e0de9164441d1cf860b386df4318e5c3 /testsuite/tests/gadt
parent34a45ee600d5346f5d1728047fa185698ed7ee84 (diff)
downloadhaskell-ffde234854f49dba9ec4735aad74b30fd2deee29.tar.gz
Do eager instantation in terms
This patch implements eager instantiation, a small but critical change to the type inference engine, #17173. The main change is this: When inferring types, always return an instantiated type (for now, deeply instantiated; in future shallowly instantiated) There is more discussion in https://www.tweag.io/posts/2020-04-02-lazy-eager-instantiation.html There is quite a bit of refactoring in this patch: * The ir_inst field of GHC.Tc.Utils.TcType.InferResultk has entirely gone. So tcInferInst and tcInferNoInst have collapsed into tcInfer. * Type inference of applications, via tcInferApp and tcInferAppHead, are substantially refactored, preparing the way for Quick Look impredicativity. * New pure function GHC.Tc.Gen.Expr.collectHsArgs and applyHsArgs are beatifully dual. We can see the zipper! * GHC.Tc.Gen.Expr.tcArgs is now much nicer; no longer needs to return a wrapper * In HsExpr, HsTypeApp now contains the the actual type argument, and is used in desugaring, rather than putting it in a mysterious wrapper. * I struggled a bit with good error reporting in Unify.matchActualFunTysPart. It's a little bit simpler than before, but still not great. Some smaller things * Rename tcPolyExpr --> tcCheckExpr tcMonoExpr --> tcLExpr * tcPatSig moves from GHC.Tc.Gen.HsType to GHC.Tc.Gen.Pat Metric Decrease: T9961 Reduction of 1.6% in comiler allocation on T9961, I think.
Diffstat (limited to 'testsuite/tests/gadt')
-rw-r--r--testsuite/tests/gadt/gadt13.stderr6
1 files changed, 3 insertions, 3 deletions
diff --git a/testsuite/tests/gadt/gadt13.stderr b/testsuite/tests/gadt/gadt13.stderr
index 6673ff68b0..cea221944b 100644
--- a/testsuite/tests/gadt/gadt13.stderr
+++ b/testsuite/tests/gadt/gadt13.stderr
@@ -8,10 +8,10 @@ gadt13.hs:15:13: error:
in an equation for ‘shw’
at gadt13.hs:15:6-8
‘p’ is a rigid type variable bound by
- the inferred type of shw :: Term a -> p at gadt13.hs:15:1-30
+ the inferred type of shw :: Term a -> p
+ at gadt13.hs:15:1-30
Possible fix: add a type signature for ‘shw’
- • Possible cause: ‘(.)’ is applied to too many arguments
- In the expression: ("I " ++) . shows t
+ • In the expression: ("I " ++) . shows t
In an equation for ‘shw’: shw (I t) = ("I " ++) . shows t
• Relevant bindings include
shw :: Term a -> p (bound at gadt13.hs:15:1)