-{-
-collect_exports :: TypeEnv -> AvailInfo -> ([C.Tcon],[C.Dcon],[C.Var]) -> ([C.Tcon],[C.Dcon],[C.Var])
-collect_exports tyenv (Avail n) (tcons,dcons,vars) = (tcons,dcons,make_var_id n:vars)
-collect_exports tyenv (AvailTC n ns) (tcons,dcons,vars) =
- case lookupNameEnv_NF tyenv n of
- ATyCon tc | isAlgTyCon tc ->
- (tcon ++ tcons,workers ++ dcons,wrappers ++ vars)
- where
- tcon = if elem n ns then [make_con_id n] else []
- workers = if isNewTyCon tc then []
- else map (make_con_id . idName . dataConId) exported_dcs
- exported_dcs = filter (\dc -> elem ((idName . dataConWrapId) dc) ns') dcs
- dcs = tyConDataConsIfAvailable tc
- wrappers = map make_var_id ns'
- ns' = filter (\n' -> n' /= n && not (elem n' recordSels)) ns
- recordSels = map idName (tyConSelIds tc)
- AClass cl -> {- maybe a little too free about exports -}
- (tcon : tcons,workers ++ dcons,wrappers ++ vars)
- where
- tcon = make_con_id (tyConName tc)
- workers = if isNewTyCon tc then []
- else map (make_con_id . idName . dataConId) dcs
- wrappers = map (make_var_id . idName . dataConWrapId) dcs
- dcs = tyConDataConsIfAvailable tc
- tc = classTyCon cl
- _ -> (tcons,dcons,vars)
--}
-
-