- entity_avail_env = mkNameEnv ([ (availName avail,avail) | avail <- effective_avails ] ++
- -- sigh - need to have the method/field names in
- -- the environment also, so that export lists
- -- can be computed precisely (cf. exportsFromAvail)
- [ (name,avail) | avail <- effective_avails,
- name <- avNames avail ] )
-
- avNames (Avail n) = [n]
- avNames (AvailTC n ns) = filter (/=n) ns
-
- -- remove 'hides' names from the avail list.
- effective_avails = foldl wipeOut avails hides
- where
- wipeOut as (Avail n) = mapMaybe (delName n) as
- wipeOut as (AvailTC n ns) = foldl wipeOut as (map Avail ns)
-
- delName x a@(Avail n)
- | n == x = Nothing
- | otherwise = Just a
- delName x (AvailTC n ns)
- = case (filter (/=x) ns) of
- [] -> Nothing
- xs -> Just (AvailTC n xs)
-
-plusExportAvails :: ExportAvails -> ExportAvails -> ExportAvails
-plusExportAvails (m1, e1) (m2, e2)
- = (plusFM_C (++) m1 m2, plusAvailEnv e1 e2)
- -- ToDo: wasteful: we do this once for each constructor!