summaryrefslogtreecommitdiff
path: root/compiler/coreSyn
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2019-10-03 23:20:13 +0100
committerRichard Eisenberg <rae@richarde.dev>2019-10-08 12:50:04 +0100
commitbe8d71d07b39f503ba9a7fc66b6735cb1da605c9 (patch)
treef32f4bf55f0a2252cdf3ce716234c4b8e52e5215 /compiler/coreSyn
parent9402608ea5955c70fee51f8b892d418252846a9b (diff)
downloadhaskell-wip/rae/split-up-modules.tar.gz
Break up TcRnTypes, among other modules.wip/rae/split-up-modules
This introduces three new modules: - basicTypes/Predicate.hs describes predicates, moving this logic out of Type. Predicates don't really exist in Core, and so don't belong in Type. - typecheck/TcOrigin.hs describes the origin of constraints and types. It was easy to remove from other modules and can often be imported instead of other, scarier modules. - typecheck/Constraint.hs describes constraints as used in the solver. It is taken from TcRnTypes. No work other than module splitting is in this patch. This is the first step toward homogeneous equality, which will rely more strongly on predicates. And homogeneous equality is the next step toward a dependently typed core language.
Diffstat (limited to 'compiler/coreSyn')
-rw-r--r--compiler/coreSyn/CoreArity.hs6
-rw-r--r--compiler/coreSyn/CoreUtils.hs1
2 files changed, 3 insertions, 4 deletions
diff --git a/compiler/coreSyn/CoreArity.hs b/compiler/coreSyn/CoreArity.hs
index d8497322a1..d940d9d69c 100644
--- a/compiler/coreSyn/CoreArity.hs
+++ b/compiler/coreSyn/CoreArity.hs
@@ -30,6 +30,7 @@ import VarEnv
import Id
import Type
import TyCon ( initRecTc, checkRecTc )
+import Predicate ( isDictTy )
import Coercion
import BasicTypes
import Unique
@@ -517,7 +518,7 @@ mk_cheap_fn dflags cheap_app
= \e mb_ty -> exprIsCheapX cheap_app e
|| case mb_ty of
Nothing -> False
- Just ty -> isDictLikeTy ty
+ Just ty -> isDictTy ty
----------------------
@@ -624,9 +625,6 @@ The (foo DInt) is floated out, and makes ineffective a RULE
One could go further and make exprIsCheap reply True to any
dictionary-typed expression, but that's more work.
-See Note [Dictionary-like types] in TcType.hs for why we use
-isDictLikeTy here rather than isDictTy
-
Note [Eta expanding thunks]
~~~~~~~~~~~~~~~~~~~~~~~~~~~
We don't eta-expand
diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs
index 95aae22b58..1ca5a6b438 100644
--- a/compiler/coreSyn/CoreUtils.hs
+++ b/compiler/coreSyn/CoreUtils.hs
@@ -77,6 +77,7 @@ import Id
import IdInfo
import PrelNames( absentErrorIdKey )
import Type
+import Predicate
import TyCoRep( TyCoBinder(..), TyBinder )
import Coercion
import TyCon