ghc-lib-parser-9.10.1.20250103: 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 #

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 #

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 #

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 #

## Manipulating these environments

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

emptyDFsEnv :: DFastStringEnv a #

dFsEnvElts :: DFastStringEnv a -> [a] #

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