summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Gen
diff options
context:
space:
mode:
authorromes <rodrigo.m.mesquita@gmail.com>2022-05-23 00:06:32 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-06 13:50:27 -0400
commit3547e2640af45ab48187387fb60795a09b662038 (patch)
tree49c9a324698d7b56d1e400c26b417150d9e1938b /compiler/GHC/Tc/Gen
parent86ced2ad8cf6fa1d829b2eea0d2dcbc049bc4a6d (diff)
downloadhaskell-3547e2640af45ab48187387fb60795a09b662038.tar.gz
Prune L.H.S modules of GHC dependencies
Move around datatypes, functions and instances that are GHC-specific out of the `Language.Haskell.Syntax.*` modules to reduce the GHC dependencies in them -- progressing towards #21592 Creates a module `Language.Haskell.Syntax.Basic` to hold basic definitions required by the other L.H.S modules (and don't belong in any of them)
Diffstat (limited to 'compiler/GHC/Tc/Gen')
-rw-r--r--compiler/GHC/Tc/Gen/Bind.hs4
-rw-r--r--compiler/GHC/Tc/Gen/Expr.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Sig.hs4
3 files changed, 5 insertions, 5 deletions
diff --git a/compiler/GHC/Tc/Gen/Bind.hs b/compiler/GHC/Tc/Gen/Bind.hs
index 08c4ca664c..3db286e3e5 100644
--- a/compiler/GHC/Tc/Gen/Bind.hs
+++ b/compiler/GHC/Tc/Gen/Bind.hs
@@ -208,7 +208,7 @@ tcCompleteSigs sigs =
-- combinations are invalid it will be found so at match sites.
-- There it is also where we consider if the type of the pattern match is
-- compatible with the result type constructor 'mb_tc'.
- doOne (L loc c@(CompleteMatchSig _ext _src_txt (L _ ns) mb_tc_nm))
+ doOne (L loc c@(CompleteMatchSig (_ext, _src_txt) (L _ ns) mb_tc_nm))
= fmap Just $ setSrcSpanA loc $ addErrCtxt (text "In" <+> ppr c) $ do
cls <- mkUniqDSet <$> mapM (addLocMA tcLookupConLike) ns
mb_tc <- traverse @Maybe tcLookupLocatedTyCon mb_tc_nm
@@ -658,7 +658,7 @@ tcPolyCheck _prag_fn sig bind
funBindTicks :: SrcSpan -> TcId -> Module -> [LSig GhcRn]
-> TcM [CoreTickish]
funBindTicks loc fun_id mod sigs
- | (mb_cc_str : _) <- [ cc_name | L _ (SCCFunSig _ _ _ cc_name) <- sigs ]
+ | (mb_cc_str : _) <- [ cc_name | L _ (SCCFunSig _ _ cc_name) <- sigs ]
-- this can only be a singleton list, as duplicate pragmas are rejected
-- by the renamer
, let cc_str
diff --git a/compiler/GHC/Tc/Gen/Expr.hs b/compiler/GHC/Tc/Gen/Expr.hs
index e26fee1f98..cb7f5cfb56 100644
--- a/compiler/GHC/Tc/Gen/Expr.hs
+++ b/compiler/GHC/Tc/Gen/Expr.hs
@@ -1376,7 +1376,7 @@ desugarRecordUpd record_expr rbnds res_ty
upd_ids_lhs = [ (NonRecursive, unitBag $ genSimpleFunBind (idName id) [] rhs)
| (_, (id, rhs)) <- upd_ids ]
mk_idSig :: (Name, (Id, LHsExpr GhcRn)) -> LSig GhcRn
- mk_idSig (_, (id, _)) = L gen $ IdSig noExtField id
+ mk_idSig (_, (id, _)) = L gen $ XSig $ IdSig id
-- We let-bind variables using 'IdSig' in order to accept
-- record updates involving higher-rank types.
-- See Wrinkle [Using IdSig] in Note [Record Updates].
diff --git a/compiler/GHC/Tc/Gen/Sig.hs b/compiler/GHC/Tc/Gen/Sig.hs
index 69e65ce2d1..ce5e3bd394 100644
--- a/compiler/GHC/Tc/Gen/Sig.hs
+++ b/compiler/GHC/Tc/Gen/Sig.hs
@@ -189,7 +189,7 @@ tcTySigs hs_sigs
; return (poly_ids, lookupNameEnv env) }
tcTySig :: LSig GhcRn -> TcM [TcSigInfo]
-tcTySig (L _ (IdSig _ id))
+tcTySig (L _ (XSig (IdSig id)))
= do { let ctxt = FunSigCtxt (idName id) NoRRC
-- NoRRC: do not report redundant constraints
-- The user has no control over the signature!
@@ -581,7 +581,7 @@ mkPragEnv sigs binds
get_sig :: LSig GhcRn -> Maybe (Name, LSig GhcRn)
get_sig sig@(L _ (SpecSig _ (L _ nm) _ _)) = Just (nm, add_arity nm sig)
get_sig sig@(L _ (InlineSig _ (L _ nm) _)) = Just (nm, add_arity nm sig)
- get_sig sig@(L _ (SCCFunSig _ _ (L _ nm) _)) = Just (nm, sig)
+ get_sig sig@(L _ (SCCFunSig _ (L _ nm) _)) = Just (nm, sig)
get_sig _ = Nothing
add_arity n sig -- Adjust inl_sat field to match visible arity of function