summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2019-11-22 20:17:19 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-12-16 19:31:44 -0500
commit3e17a866fecebc5f80b4e7da93a73803b86499ca (patch)
treee43ec9825c4d4a17a0f897c7445584dcdddeec5e
parent9431f905a1eabcb823b65460560558c08fb55cd9 (diff)
downloadhaskell-3e17a866fecebc5f80b4e7da93a73803b86499ca.tar.gz
Remove dataConSig
As suggested in #17291
-rw-r--r--compiler/basicTypes/DataCon.hs18
-rw-r--r--compiler/main/GHC.hs2
-rw-r--r--compiler/typecheck/TcTyClsDecls.hs4
3 files changed, 4 insertions, 20 deletions
diff --git a/compiler/basicTypes/DataCon.hs b/compiler/basicTypes/DataCon.hs
index 47eb7a838b..d48ecead11 100644
--- a/compiler/basicTypes/DataCon.hs
+++ b/compiler/basicTypes/DataCon.hs
@@ -27,7 +27,7 @@ module DataCon (
mkDataCon, buildAlgTyCon, buildSynTyCon, fIRST_TAG,
-- ** Type deconstruction
- dataConRepType, dataConSig, dataConInstSig, dataConFullSig,
+ dataConRepType, dataConInstSig, dataConFullSig,
dataConName, dataConIdentity, dataConTag, dataConTagZ,
dataConTyCon, dataConOrigTyCon,
dataConUserType,
@@ -1207,22 +1207,6 @@ dataConBoxer :: DataCon -> Maybe DataConBoxer
dataConBoxer (MkData { dcRep = DCR { dcr_boxer = boxer } }) = Just boxer
dataConBoxer _ = Nothing
--- | The \"signature\" of the 'DataCon' returns, in order:
---
--- 1) The result of 'dataConUnivAndExTyCoVars',
---
--- 2) All the 'ThetaType's relating to the 'DataCon' (coercion, dictionary,
--- implicit parameter - whatever), including dependent GADT equalities.
--- Dependent GADT equalities are *also* listed in return value (1), so be
--- careful!
---
--- 3) The type arguments to the constructor
---
--- 4) The /original/ result type of the 'DataCon'
-dataConSig :: DataCon -> ([TyCoVar], ThetaType, [Type], Type)
-dataConSig con@(MkData {dcOrigArgTys = arg_tys, dcOrigResTy = res_ty})
- = (dataConUnivAndExTyCoVars con, dataConTheta con, arg_tys, res_ty)
-
dataConInstSig
:: DataCon
-> [Type] -- Instantiate the *universal* tyvars with these types
diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs
index 80131c6329..def7065ab6 100644
--- a/compiler/main/GHC.hs
+++ b/compiler/main/GHC.hs
@@ -196,7 +196,7 @@ module GHC (
-- ** Data constructors
DataCon,
- dataConSig, dataConType, dataConTyCon, dataConFieldLabels,
+ dataConType, dataConTyCon, dataConFieldLabels,
dataConIsInfix, isVanillaDataCon, dataConUserType,
dataConSrcBangs,
StrictnessMark(..), isMarkedStrict,
diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs
index bfd5567949..0695dd8970 100644
--- a/compiler/typecheck/TcTyClsDecls.hs
+++ b/compiler/typecheck/TcTyClsDecls.hs
@@ -3467,7 +3467,7 @@ checkValidTyCon tc
-- NB: this check assumes that all the constructors of a given
-- data type use the same type variables
where
- (_, _, _, res1) = dataConSig con1
+ res1 = dataConOrigResTy con1
fty1 = dataConFieldType con1 lbl
lbl = flLabel label
@@ -3475,7 +3475,7 @@ checkValidTyCon tc
= do { checkFieldCompat lbl con1 con2 res1 res2 fty1 fty2
; checkFieldCompat lbl con2 con1 res2 res1 fty2 fty1 }
where
- (_, _, _, res2) = dataConSig con2
+ res2 = dataConOrigResTy con2
fty2 = dataConFieldType con2 lbl
checkPartialRecordField :: [DataCon] -> FieldLabel -> TcM ()