ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

NameEnv

Contents

- Var, Id and TyVar environments (maps)
  - Manipulating these environments
  - Dependency analysis

Synopsis

- type NameEnv a = UniqFM a
- mkNameEnv :: [(Name, a)] -> NameEnv a
- emptyNameEnv :: NameEnv a
- isEmptyNameEnv :: NameEnv a -> Bool
- unitNameEnv :: Name -> a -> NameEnv a
- nameEnvElts :: NameEnv a -> [a]
- extendNameEnv_C :: (a -> a -> a) -> NameEnv a -> Name -> a -> NameEnv a
- extendNameEnv_Acc :: (a -> b -> b) -> (a -> b) -> NameEnv b -> Name -> a -> NameEnv b
- extendNameEnv :: NameEnv a -> Name -> a -> NameEnv a
- extendNameEnvList :: NameEnv a -> [(Name, a)] -> NameEnv a
- extendNameEnvList_C :: (a -> a -> a) -> NameEnv a -> [(Name, a)] -> NameEnv a
- filterNameEnv :: (elt -> Bool) -> NameEnv elt -> NameEnv elt
- anyNameEnv :: (elt -> Bool) -> NameEnv elt -> Bool
- plusNameEnv :: NameEnv a -> NameEnv a -> NameEnv a
- plusNameEnv_C :: (a -> a -> a) -> NameEnv a -> NameEnv a -> NameEnv a
- alterNameEnv :: (Maybe a -> Maybe a) -> NameEnv a -> Name -> NameEnv a
- lookupNameEnv :: NameEnv a -> Name -> Maybe a
- lookupNameEnv_NF :: NameEnv a -> Name -> a
- delFromNameEnv :: NameEnv a -> Name -> NameEnv a
- delListFromNameEnv :: NameEnv a -> [Name] -> NameEnv a
- elemNameEnv :: Name -> NameEnv a -> Bool
- mapNameEnv :: (elt1 -> elt2) -> NameEnv elt1 -> NameEnv elt2
- disjointNameEnv :: NameEnv a -> NameEnv a -> Bool
- type DNameEnv a = UniqDFM a
- emptyDNameEnv :: DNameEnv a
- lookupDNameEnv :: DNameEnv a -> Name -> Maybe a
- mapDNameEnv :: (a -> b) -> DNameEnv a -> DNameEnv b
- alterDNameEnv :: (Maybe a -> Maybe a) -> DNameEnv a -> Name -> DNameEnv a
- depAnal :: (node -> [Name]) -> (node -> [Name]) -> [node] -> [SCC node]

# Var, Id and TyVar environments (maps)

type NameEnv a = UniqFM a #

Name Environment

## Manipulating these environments

mkNameEnv :: [(Name, a)] -> NameEnv a #

emptyNameEnv :: NameEnv a #

isEmptyNameEnv :: NameEnv a -> Bool #

unitNameEnv :: Name -> a -> NameEnv a #

nameEnvElts :: NameEnv a -> [a] #

extendNameEnv_C :: (a -> a -> a) -> NameEnv a -> Name -> a -> NameEnv a #

extendNameEnv_Acc :: (a -> b -> b) -> (a -> b) -> NameEnv b -> Name -> a -> NameEnv b #

extendNameEnv :: NameEnv a -> Name -> a -> NameEnv a #

extendNameEnvList :: NameEnv a -> [(Name, a)] -> NameEnv a #

extendNameEnvList_C :: (a -> a -> a) -> NameEnv a -> [(Name, a)] -> NameEnv a #

filterNameEnv :: (elt -> Bool) -> NameEnv elt -> NameEnv elt #

anyNameEnv :: (elt -> Bool) -> NameEnv elt -> Bool #

plusNameEnv :: NameEnv a -> NameEnv a -> NameEnv a #

plusNameEnv_C :: (a -> a -> a) -> NameEnv a -> NameEnv a -> NameEnv a #

alterNameEnv :: (Maybe a -> Maybe a) -> NameEnv a -> Name -> NameEnv a #

lookupNameEnv :: NameEnv a -> Name -> Maybe a #

lookupNameEnv_NF :: NameEnv a -> Name -> a #

delFromNameEnv :: NameEnv a -> Name -> NameEnv a #

delListFromNameEnv :: NameEnv a -> [Name] -> NameEnv a #

elemNameEnv :: Name -> NameEnv a -> Bool #

mapNameEnv :: (elt1 -> elt2) -> NameEnv elt1 -> NameEnv elt2 #

disjointNameEnv :: NameEnv a -> NameEnv a -> Bool #

type DNameEnv a = UniqDFM a #

Deterministic Name Environment

See Note [Deterministic UniqFM] in UniqDFM for explanation why we need DNameEnv.

emptyDNameEnv :: DNameEnv a #

lookupDNameEnv :: DNameEnv a -> Name -> Maybe a #

mapDNameEnv :: (a -> b) -> DNameEnv a -> DNameEnv b #

alterDNameEnv :: (Maybe a -> Maybe a) -> DNameEnv a -> Name -> DNameEnv a #

## Dependency analysis

depAnal :: (node -> [Name]) -> (node -> [Name]) -> [node] -> [SCC node] #