ghc-lib-parser-9.12.2.20250421: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Data.FastString.Env

Contents

- FastString environments (maps)
  - Manipulating these environments
- Deterministic FastString environments (maps)
  - Manipulating these environments

Description

Synopsis

- type FastStringEnv a = UniqFM FastString a
- mkFsEnv :: [(FastString, a)] -> FastStringEnv a
- emptyFsEnv :: FastStringEnv a
- unitFsEnv :: FastString -> a -> FastStringEnv a
- extendFsEnv_C :: (a -> a -> a) -> FastStringEnv a -> FastString -> a -> FastStringEnv a
- extendFsEnv_Acc :: (a -> b -> b) -> (a -> b) -> FastStringEnv b -> FastString -> a -> FastStringEnv b
- extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a
- extendFsEnvList :: FastStringEnv a -> [(FastString, a)] -> FastStringEnv a
- extendFsEnvList_C :: (a -> a -> a) -> FastStringEnv a -> [(FastString, a)] -> FastStringEnv a
- filterFsEnv :: (elt -> Bool) -> FastStringEnv elt -> FastStringEnv elt
- plusFsEnv :: FastStringEnv a -> FastStringEnv a -> FastStringEnv a
- plusFsEnv_C :: (a -> a -> a) -> FastStringEnv a -> FastStringEnv a -> FastStringEnv a
- alterFsEnv :: (Maybe a -> Maybe a) -> FastStringEnv a -> FastString -> FastStringEnv a
- lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a
- lookupFsEnv_NF :: FastStringEnv a -> FastString -> a
- delFromFsEnv :: FastStringEnv a -> FastString -> FastStringEnv a
- delListFromFsEnv :: FastStringEnv a -> [FastString] -> FastStringEnv a
- elemFsEnv :: FastString -> FastStringEnv a -> Bool
- mapFsEnv :: (elt1 -> elt2) -> FastStringEnv elt1 -> FastStringEnv elt2
- strictMapFsEnv :: (a -> b) -> FastStringEnv a -> FastStringEnv b
- mapMaybeFsEnv :: (elt1 -> Maybe elt2) -> FastStringEnv elt1 -> FastStringEnv elt2
- nonDetFoldFsEnv :: (a -> b -> b) -> b -> FastStringEnv a -> b
- type DFastStringEnv a = UniqDFM FastString a
- mkDFsEnv :: [(FastString, a)] -> DFastStringEnv a
- emptyDFsEnv :: DFastStringEnv a
- dFsEnvElts :: DFastStringEnv a -> [a]
- lookupDFsEnv :: DFastStringEnv a -> FastString -> Maybe a

# FastString environments (maps)

type FastStringEnv a = UniqFM FastString a Source #

A non-deterministic set of FastStrings. See Note [Deterministic UniqFM] in GHC.Types.Unique.DFM for explanation why it's not deterministic and why it matters. Use DFastStringEnv if the set eventually gets converted into a list or folded over in a way where the order changes the generated code.

## Manipulating these environments

mkFsEnv :: [(FastString, a)] -> FastStringEnv a Source #

emptyFsEnv :: FastStringEnv a Source #

unitFsEnv :: FastString -> a -> FastStringEnv a Source #

extendFsEnv_C :: (a -> a -> a) -> FastStringEnv a -> FastString -> a -> FastStringEnv a Source #

extendFsEnv_Acc :: (a -> b -> b) -> (a -> b) -> FastStringEnv b -> FastString -> a -> FastStringEnv b Source #

extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a Source #

extendFsEnvList :: FastStringEnv a -> [(FastString, a)] -> FastStringEnv a Source #

extendFsEnvList_C :: (a -> a -> a) -> FastStringEnv a -> [(FastString, a)] -> FastStringEnv a Source #

filterFsEnv :: (elt -> Bool) -> FastStringEnv elt -> FastStringEnv elt Source #

plusFsEnv :: FastStringEnv a -> FastStringEnv a -> FastStringEnv a Source #

plusFsEnv_C :: (a -> a -> a) -> FastStringEnv a -> FastStringEnv a -> FastStringEnv a Source #

alterFsEnv :: (Maybe a -> Maybe a) -> FastStringEnv a -> FastString -> FastStringEnv a Source #

lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a Source #

lookupFsEnv_NF :: FastStringEnv a -> FastString -> a Source #

delFromFsEnv :: FastStringEnv a -> FastString -> FastStringEnv a Source #

delListFromFsEnv :: FastStringEnv a -> [FastString] -> FastStringEnv a Source #

elemFsEnv :: FastString -> FastStringEnv a -> Bool Source #

mapFsEnv :: (elt1 -> elt2) -> FastStringEnv elt1 -> FastStringEnv elt2 Source #

strictMapFsEnv :: (a -> b) -> FastStringEnv a -> FastStringEnv b Source #

mapMaybeFsEnv :: (elt1 -> Maybe elt2) -> FastStringEnv elt1 -> FastStringEnv elt2 Source #

nonDetFoldFsEnv :: (a -> b -> b) -> b -> FastStringEnv a -> b Source #

Fold over a `FastStringEnv`.

Non-deterministic, unless the folding function is commutative (i.e. `a1 `f` ( a2 `f` b ) == a2 `f` ( a1 `f` b )` for all `a1`, `a2`, `b`).

# Deterministic FastString environments (maps)

type DFastStringEnv a = UniqDFM FastString a Source #

## Manipulating these environments

mkDFsEnv :: [(FastString, a)] -> DFastStringEnv a Source #

emptyDFsEnv :: DFastStringEnv a Source #

dFsEnvElts :: DFastStringEnv a -> [a] Source #

lookupDFsEnv :: DFastStringEnv a -> FastString -> Maybe a Source #