import Unique
import UniqFM
import UniqSet
-import Util ( singleton )
-import Digraph ( SCC(..), stronglyConnComp )
+import Util
+import Digraph ( SCC(..), stronglyConnCompFromEdgedVertices )
import Outputable
import FastString
vectTyConDecls :: [TyCon] -> VM [TyCon]
vectTyConDecls tcs = fixV $ \tcs' ->
do
- mapM_ (uncurry defTyCon) (lazy_zip tcs tcs')
+ mapM_ (uncurry defTyCon) (zipLazy tcs tcs')
mapM vectTyConDecl tcs
- where
- lazy_zip [] _ = []
- lazy_zip (x:xs) ~(y:ys) = (x,y) : lazy_zip xs ys
vectTyConDecl :: TyCon -> VM TyCon
vectTyConDecl tc
liftDs $ buildSynTyCon name
tyvars
(SynonymTyCon rhs_ty)
+ (typeKind rhs_ty)
(Just $ mk_fam_inst prepr_tc vect_tc)
where
tyvars = tyConTyVars vect_tc
mkRepr :: TyCon -> VM Repr
mkRepr vect_tc
| [tys] <- rep_tys = boxedProductRepr tys
- -- | all null rep_tys = enumRepr
+ -- removed: | all null rep_tys = enumRepr
| otherwise = sumRepr =<< mapM unboxedProductRepr rep_tys
where
rep_tys = map dataConRepArgTys $ tyConDataCons vect_tc
from_repr _ _ _ _ _ _ = panic "buildFromArrPRepr/from_repr"
- from_prod prod@(ProdRepr { prod_components = tys
- , prod_arr_tycon = tycon
- , prod_arr_data_con = data_con })
+ from_prod (ProdRepr { prod_components = tys
+ , prod_arr_tycon = tycon
+ , prod_arr_data_con = data_con })
expr
shape_vars
repr_vars
= do
let scrut = unwrapFamInstScrut tycon tys expr
scrut_ty = mkTyConApp tycon tys
- _ty <- arrReprType prod
return $ Case scrut (mkWildId scrut_ty) res_ty
[(DataAlt data_con, shape_vars ++ repr_vars, body)]
-- | Compute mutually recursive groups of tycons in topological order
--
tyConGroups :: [TyCon] -> [TyConGroup]
-tyConGroups tcs = map mk_grp (stronglyConnComp edges)
+tyConGroups tcs = map mk_grp (stronglyConnCompFromEdgedVertices edges)
where
edges = [((tc, ds), tc, uniqSetToList ds) | tc <- tcs
, let ds = tyConsOfTyCon tc]