summaryrefslogtreecommitdiff
path: root/compiler/typecheck/TcInteract.hs
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2019-10-03 23:20:13 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-16 15:58:58 -0400
commit51fad9e6693fdf8964d104425122d0010229c939 (patch)
tree8268d84ed6f18ac3df26e5c7475f2aa9cd54ad54 /compiler/typecheck/TcInteract.hs
parent798037a1f6823c72e3ba59ed726d0ff74d0245e8 (diff)
downloadhaskell-51fad9e6693fdf8964d104425122d0010229c939.tar.gz
Break up TcRnTypes, among other 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/typecheck/TcInteract.hs')
-rw-r--r--compiler/typecheck/TcInteract.hs14
1 files changed, 10 insertions, 4 deletions
diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs
index 9122a04436..dbc564a9d3 100644
--- a/compiler/typecheck/TcInteract.hs
+++ b/compiler/typecheck/TcInteract.hs
@@ -35,6 +35,9 @@ import TcEvidence
import Outputable
import TcRnTypes
+import Constraint
+import Predicate
+import TcOrigin
import TcSMonad
import Bag
import MonadUtils ( concatMapM, foldlM )
@@ -1181,8 +1184,12 @@ addFunDepWork inerts work_ev cls
inert_loc = ctEvLoc inert_ev
derived_loc = work_loc { ctl_depth = ctl_depth work_loc `maxSubGoalDepth`
ctl_depth inert_loc
- , ctl_origin = FunDepOrigin1 work_pred work_loc
- inert_pred inert_loc }
+ , ctl_origin = FunDepOrigin1 work_pred
+ (ctLocOrigin work_loc)
+ (ctLocSpan work_loc)
+ inert_pred
+ (ctLocOrigin inert_loc)
+ (ctLocSpan inert_loc) }
{-
**********************************************************************
@@ -1860,7 +1867,7 @@ selection. This avoids having to support quantified constraints whose
kind is not Constraint, such as (forall a. F a ~# b)
See
- * Note [Evidence for quantified constraints] in Type
+ * Note [Evidence for quantified constraints] in Predicate
* Note [Equality superclasses in quantified constraints]
in TcCanonical
-}
@@ -2609,4 +2616,3 @@ matchLocalInst pred loc
qtv_set = mkVarSet qtvs
this_unif = mightMatchLater qpred (ctEvLoc ev) pred loc
(matches, unif) = match_local_inst qcis
-