Commit 030abf9e authored by Simon Peyton Jones's avatar Simon Peyton Jones

Remove unused tyConsOfDataCon

parent 0f930ba2
......@@ -34,8 +34,6 @@ module DataCon (
-- ** Predicates on DataCons
isNullarySrcDataCon, isNullaryRepDataCon, isTupleDataCon, isUnboxedTupleCon,
isVanillaDataCon, classDataCon, dataConCannotMatch,
......@@ -67,7 +65,6 @@ import BasicTypes
import FastString
import Module
import VarEnv
import NameEnv
import qualified Data.Data as Data
import qualified Data.Typeable
......@@ -1126,15 +1123,4 @@ splitDataProductType_maybe ty
= Just (tycon, ty_args, con, dataConInstArgTys con ty_args)
| otherwise
= Nothing
-- | All type constructors used in the definition of this type constructor,
-- recursively. This is used to find out all the type constructors whose data
-- constructors need to be in scope to be allowed to safely coerce under this
-- type constructor in Safe Haskell mode.
tyConsOfTyCon :: TyCon -> [TyCon]
tyConsOfTyCon tc = nameEnvElts (add tc emptyNameEnv)
go env tc = foldr add env (tyConDataCons tc >>= dataConOrigArgTys >>= tyConsOfType)
add tc env | tyConName tc `elemNameEnv` env = env
| otherwise = go (extendNameEnv env (tyConName tc) tc) tc
......@@ -21,7 +21,7 @@ where
import NameSet
import UniqSet
import UniqFM
import DataCon hiding (tyConsOfTyCon)
import DataCon
import TyCon
import TypeRep
import Type hiding (tyConsOfType)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment