summaryrefslogtreecommitdiff
path: root/compiler/iface
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2017-12-26 12:54:27 +0000
committerBartosz Nitka <niteria@gmail.com>2018-01-04 14:03:54 +0000
commit6c34824434a67baa34e4ee2ddb753708eb61c5bc (patch)
treeca8c84cae978b3cc61ff096f74016d7aebfd1707 /compiler/iface
parent649e777211fe08432900093002547d7358f92d82 (diff)
downloadhaskell-6c34824434a67baa34e4ee2ddb753708eb61c5bc.tar.gz
Cache the number of data cons in DataTyCon and SumTyCon
This is a follow-up after faf60e85 - Make tagForCon non-linear. On the mailing list @simonpj suggested to solve the linear behavior by caching the sizes. Test Plan: ./validate Reviewers: simonpj, simonmar, bgamari, austin Reviewed By: simonpj Subscribers: carter, goldfire, rwbarton, thomie, simonpj Differential Revision: https://phabricator.haskell.org/D4131
Diffstat (limited to 'compiler/iface')
-rw-r--r--compiler/iface/BuildTyCl.hs15
1 files changed, 1 insertions, 14 deletions
diff --git a/compiler/iface/BuildTyCl.hs b/compiler/iface/BuildTyCl.hs
index 3d34e6f5fd..113ec12b63 100644
--- a/compiler/iface/BuildTyCl.hs
+++ b/compiler/iface/BuildTyCl.hs
@@ -9,7 +9,7 @@ module BuildTyCl (
buildDataCon,
buildPatSyn,
TcMethInfo, buildClass,
- mkNewTyConRhs, mkDataTyConRhs,
+ mkNewTyConRhs,
newImplicitBinder, newTyConRepName
) where
@@ -41,19 +41,6 @@ import UniqSupply
import Util
import Outputable
-mkDataTyConRhs :: [DataCon] -> AlgTyConRhs
-mkDataTyConRhs cons
- = DataTyCon {
- data_cons = cons,
- is_enum = not (null cons) && all is_enum_con cons
- -- See Note [Enumeration types] in TyCon
- }
- where
- is_enum_con con
- | (_univ_tvs, ex_tvs, eq_spec, theta, arg_tys, _res)
- <- dataConFullSig con
- = null ex_tvs && null eq_spec && null theta && null arg_tys
-
mkNewTyConRhs :: Name -> TyCon -> DataCon -> TcRnIf m n AlgTyConRhs
-- ^ Monadic because it makes a Name for the coercion TyCon