summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2010-01-04 08:21:55 +0000
committersimonpj@microsoft.com <unknown>2010-01-04 08:21:55 +0000
commitb06d623b2e367a572de5daf06d6a0b12c2740471 (patch)
tree6b7928ccf7e14bef94358e5bc58c38f4e0a030e7 /compiler/parser
parent3029576129e31d23e749be21c6a5a6f376ba28cd (diff)
downloadhaskell-b06d623b2e367a572de5daf06d6a0b12c2740471.tar.gz
Substantial improvements to coercion optimisation
The main purpose of this patch is to add a bunch of new rules to the coercion optimiser. They are documented in the (revised) Appendix of the System FC paper. Some code has moved about: - OptCoercion is now a separate module, mainly because it now uses tcMatchTy, which is defined in Unify, so OptCoercion must live higehr up in the hierarchy - Functions that manipulate Kinds has moved from Type.lhs to Coercion.lhs. Reason: the function typeKind now needs to call coercionKind. And in any case, a Kind is a flavour of Type, so it builds on top of Type; indeed Coercions and Kinds are both flavours of Type. This change required fiddling with a number of imports, hence the one-line changes to otherwise-unrelated modules - The representation of CoTyCons in TyCon has changed. Instead of an extensional representation (a kind checker) there is now an intensional representation (namely TyCon.CoTyConDesc). This was needed for one of the new coercion optimisations.
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Parser.y.pp3
-rw-r--r--compiler/parser/ParserCore.y3
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 4cd637fb34..212a79ce36 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -45,7 +45,8 @@ import SrcLoc ( Located(..), unLoc, getLoc, noLoc, combineSrcSpans,
mkSrcLoc, mkSrcSpan )
import Module
import StaticFlags ( opt_SccProfilingOn, opt_Hpc )
-import Type ( Kind, mkArrowKind, liftedTypeKind, unliftedTypeKind )
+import Type ( Kind, liftedTypeKind, unliftedTypeKind )
+import Coercion ( mkArrowKind )
import Class ( FunDep )
import BasicTypes ( Boxity(..), Fixity(..), FixityDirection(..), IPName(..),
Activation(..), RuleMatchInfo(..), defaultInlinePragma )
diff --git a/compiler/parser/ParserCore.y b/compiler/parser/ParserCore.y
index 6839fa2d45..f43e225041 100644
--- a/compiler/parser/ParserCore.y
+++ b/compiler/parser/ParserCore.y
@@ -16,8 +16,9 @@ import RdrName
import OccName
import Type ( Kind,
liftedTypeKindTyCon, openTypeKindTyCon, unliftedTypeKindTyCon,
- argTypeKindTyCon, ubxTupleKindTyCon, mkArrowKind, mkTyConApp
+ argTypeKindTyCon, ubxTupleKindTyCon, mkTyConApp
)
+import Coercion( mkArrowKind )
import Name( Name, nameOccName, nameModule, mkExternalName )
import Module
import ParserCoreUtils