-mk_edges decl@(ClassDecl ctxt name _ _ sigs _ _ _ _ _ _ _)
- = (decl, getUnique name, uniqSetToList (get_ctxt ctxt `unionUniqSets`
- get_sigs sigs))
-
-
-----------------------------------------------------
-get_ctxt ctxt = unionManyUniqSets (map set_name (catMaybes (map get_clas ctxt)))
-get_clas (HsPClass clas _) = Just clas
-get_clas _ = Nothing
-
-----------------------------------------------------
-get_deriv Nothing = emptyUniqSet
-get_deriv (Just clss) = unionManyUniqSets (map set_name clss)
-
-----------------------------------------------------
-get_cons cons = unionManyUniqSets (map get_con cons)
-
-----------------------------------------------------
-get_con (ConDecl _ _ _ ctxt details _)
- = get_ctxt ctxt `unionUniqSets` get_con_details details
-
-----------------------------------------------------
-get_con_details (VanillaCon btys) = unionManyUniqSets (map get_bty btys)
-get_con_details (InfixCon bty1 bty2) = unionUniqSets (get_bty bty1) (get_bty bty2)
-get_con_details (RecCon nbtys) = unionManyUniqSets (map (get_bty.snd) nbtys)
-
-----------------------------------------------------
-get_bty bty = get_ty (getBangType bty)
-
-----------------------------------------------------
-get_ty (HsTyVar name) | isTvOcc (nameOccName name) = emptyUniqSet
- | otherwise = set_name name
-get_ty (HsAppTy ty1 ty2) = unionUniqSets (get_ty ty1) (get_ty ty2)
-get_ty (HsFunTy ty1 ty2) = unionUniqSets (get_ty ty1) (get_ty ty2)
-get_ty (HsListTy ty) = set_name listTyCon_name `unionUniqSets` get_ty ty
-get_ty (HsTupleTy (HsTupCon n _) tys) = set_name n `unionUniqSets` get_tys tys
-get_ty (HsUsgTy _ ty) = get_ty ty
-get_ty (HsUsgForAllTy _ ty) = get_ty ty
-get_ty (HsForAllTy _ ctxt mty) = get_ctxt ctxt `unionUniqSets` get_ty mty
-get_ty (HsPredTy (HsPClass name _)) = set_name name
-get_ty (HsPredTy (HsPIParam _ _)) = emptyUniqSet -- I think
-
-----------------------------------------------------
-get_tys tys = unionManyUniqSets (map get_ty tys)
-
-----------------------------------------------------
-get_sigs sigs
- = unionManyUniqSets (map get_sig sigs)
- where
- get_sig (ClassOpSig _ _ ty _) = get_ty ty
- get_sig (FixSig _) = emptyUniqSet
- get_sig other = panic "TcTyClsDecls:get_sig"
-
-----------------------------------------------------
-set_name name = unitUniqSet (getUnique name)