ghc-lib-parser-8.10.5.20210606: The GHC API, decoupled from GHC versions
Safe HaskellNone
LanguageHaskell2010

TrieMap

Synopsis

Maps over Maybe values

data MaybeMap m a Source #

Instances

Instances details
TrieMap m => TrieMap (MaybeMap m) Source # 
Instance details

Defined in TrieMap

Associated Types

type Key (MaybeMap m) Source #

Methods

emptyTM :: MaybeMap m a Source #

lookupTM :: Key (MaybeMap m) -> MaybeMap m b -> Maybe b Source #

alterTM :: Key (MaybeMap m) -> XT b -> MaybeMap m b -> MaybeMap m b Source #

mapTM :: (a -> b) -> MaybeMap m a -> MaybeMap m b Source #

foldTM :: (a -> b -> b) -> MaybeMap m a -> b -> b Source #

type Key (MaybeMap m) Source # 
Instance details

Defined in TrieMap

type Key (MaybeMap m) = Maybe (Key m)

Maps over List values

data ListMap m a Source #

Instances

Instances details
TrieMap m => TrieMap (ListMap m) Source # 
Instance details

Defined in TrieMap

Associated Types

type Key (ListMap m) Source #

Methods

emptyTM :: ListMap m a Source #

lookupTM :: Key (ListMap m) -> ListMap m b -> Maybe b Source #

alterTM :: Key (ListMap m) -> XT b -> ListMap m b -> ListMap m b Source #

mapTM :: (a -> b) -> ListMap m a -> ListMap m b Source #

foldTM :: (a -> b -> b) -> ListMap m a -> b -> b Source #

(TrieMap m, Outputable a) => Outputable (ListMap m a) Source # 
Instance details

Defined in TrieMap

Methods

ppr :: ListMap m a -> SDoc Source #

pprPrec :: Rational -> ListMap m a -> SDoc Source #

type Key (ListMap m) Source # 
Instance details

Defined in TrieMap

type Key (ListMap m) = [Key m]

Maps over Literals

TrieMap class

class TrieMap m where Source #

Associated Types

type Key m :: * Source #

Methods

emptyTM :: m a Source #

lookupTM :: forall b. Key m -> m b -> Maybe b Source #

alterTM :: forall b. Key m -> XT b -> m b -> m b Source #

mapTM :: (a -> b) -> m a -> m b Source #

foldTM :: (a -> b -> b) -> m a -> b -> b Source #

Instances

Instances details
TrieMap IntMap Source # 
Instance details

Defined in TrieMap

Associated Types

type Key IntMap Source #

Methods

emptyTM :: IntMap a Source #

lookupTM :: Key IntMap -> IntMap b -> Maybe b Source #

alterTM :: Key IntMap -> XT b -> IntMap b -> IntMap b Source #

mapTM :: (a -> b) -> IntMap a -> IntMap b Source #

foldTM :: (a -> b -> b) -> IntMap a -> b -> b Source #

TrieMap UniqDFM Source # 
Instance details

Defined in TrieMap

Associated Types

type Key UniqDFM Source #

Methods

emptyTM :: UniqDFM a Source #

lookupTM :: Key UniqDFM -> UniqDFM b -> Maybe b Source #

alterTM :: Key UniqDFM -> XT b -> UniqDFM b -> UniqDFM b Source #

mapTM :: (a -> b) -> UniqDFM a -> UniqDFM b Source #

foldTM :: (a -> b -> b) -> UniqDFM a -> b -> b Source #

TrieMap LooseTypeMap Source # 
Instance details

Defined in CoreMap

Associated Types

type Key LooseTypeMap Source #

TrieMap TypeMap Source # 
Instance details

Defined in CoreMap

Associated Types

type Key TypeMap Source #

Methods

emptyTM :: TypeMap a Source #

lookupTM :: Key TypeMap -> TypeMap b -> Maybe b Source #

alterTM :: Key TypeMap -> XT b -> TypeMap b -> TypeMap b Source #

mapTM :: (a -> b) -> TypeMap a -> TypeMap b Source #

foldTM :: (a -> b -> b) -> TypeMap a -> b -> b Source #

TrieMap CoreMap Source # 
Instance details

Defined in CoreMap

Associated Types

type Key CoreMap Source #

Methods

emptyTM :: CoreMap a Source #

lookupTM :: Key CoreMap -> CoreMap b -> Maybe b Source #

alterTM :: Key CoreMap -> XT b -> CoreMap b -> CoreMap b Source #

mapTM :: (a -> b) -> CoreMap a -> CoreMap b Source #

foldTM :: (a -> b -> b) -> CoreMap a -> b -> b Source #

Ord k => TrieMap (Map k) Source # 
Instance details

Defined in TrieMap

Associated Types

type Key (Map k) Source #

Methods

emptyTM :: Map k a Source #

lookupTM :: Key (Map k) -> Map k b -> Maybe b Source #

alterTM :: Key (Map k) -> XT b -> Map k b -> Map k b Source #

mapTM :: (a -> b) -> Map k a -> Map k b Source #

foldTM :: (a -> b -> b) -> Map k a -> b -> b Source #

(Eq (Key m), TrieMap m) => TrieMap (GenMap m) Source # 
Instance details

Defined in TrieMap

Associated Types

type Key (GenMap m) Source #

Methods

emptyTM :: GenMap m a Source #

lookupTM :: Key (GenMap m) -> GenMap m b -> Maybe b Source #

alterTM :: Key (GenMap m) -> XT b -> GenMap m b -> GenMap m b Source #

mapTM :: (a -> b) -> GenMap m a -> GenMap m b Source #

foldTM :: (a -> b -> b) -> GenMap m a -> b -> b Source #

TrieMap m => TrieMap (ListMap m) Source # 
Instance details

Defined in TrieMap

Associated Types

type Key (ListMap m) Source #

Methods

emptyTM :: ListMap m a Source #

lookupTM :: Key (ListMap m) -> ListMap m b -> Maybe b Source #

alterTM :: Key (ListMap m) -> XT b -> ListMap m b -> ListMap m b Source #

mapTM :: (a -> b) -> ListMap m a -> ListMap m b Source #

foldTM :: (a -> b -> b) -> ListMap m a -> b -> b Source #

TrieMap m => TrieMap (MaybeMap m) Source # 
Instance details

Defined in TrieMap

Associated Types

type Key (MaybeMap m) Source #

Methods

emptyTM :: MaybeMap m a Source #

lookupTM :: Key (MaybeMap m) -> MaybeMap m b -> Maybe b Source #

alterTM :: Key (MaybeMap m) -> XT b -> MaybeMap m b -> MaybeMap m b Source #

mapTM :: (a -> b) -> MaybeMap m a -> MaybeMap m b Source #

foldTM :: (a -> b -> b) -> MaybeMap m a -> b -> b Source #

insertTM :: TrieMap m => Key m -> a -> m a -> m a Source #

deleteTM :: TrieMap m => Key m -> m a -> m a Source #

Things helpful for adding additional Instances.

(>.>) :: (a -> b) -> (b -> c) -> a -> c infixr 1 Source #

(|>) :: a -> (a -> b) -> b infixr 1 Source #

(|>>) :: TrieMap m2 => (XT (m2 a) -> m1 (m2 a) -> m1 (m2 a)) -> (m2 a -> m2 a) -> m1 (m2 a) -> m1 (m2 a) infixr 1 Source #

type XT a = Maybe a -> Maybe a Source #

foldMaybe :: (a -> b -> b) -> Maybe a -> b -> b Source #

Map for leaf compression

data GenMap m a Source #

Instances

Instances details
(Eq (Key m), TrieMap m) => TrieMap (GenMap m) Source # 
Instance details

Defined in TrieMap

Associated Types

type Key (GenMap m) Source #

Methods

emptyTM :: GenMap m a Source #

lookupTM :: Key (GenMap m) -> GenMap m b -> Maybe b Source #

alterTM :: Key (GenMap m) -> XT b -> GenMap m b -> GenMap m b Source #

mapTM :: (a -> b) -> GenMap m a -> GenMap m b Source #

foldTM :: (a -> b -> b) -> GenMap m a -> b -> b Source #

(Outputable a, Outputable (m a)) => Outputable (GenMap m a) Source # 
Instance details

Defined in TrieMap

Methods

ppr :: GenMap m a -> SDoc Source #

pprPrec :: Rational -> GenMap m a -> SDoc Source #

type Key (GenMap m) Source # 
Instance details

Defined in TrieMap

type Key (GenMap m) = Key m

lkG :: (Eq (Key m), TrieMap m) => Key m -> GenMap m a -> Maybe a Source #

xtG :: (Eq (Key m), TrieMap m) => Key m -> XT a -> GenMap m a -> GenMap m a Source #

mapG :: TrieMap m => (a -> b) -> GenMap m a -> GenMap m b Source #

fdG :: TrieMap m => (a -> b -> b) -> GenMap m a -> b -> b Source #

xtList :: TrieMap m => (forall b. k -> XT b -> m b -> m b) -> [k] -> XT a -> ListMap m a -> ListMap m a Source #

lkList :: TrieMap m => (forall b. k -> m b -> Maybe b) -> [k] -> ListMap m a -> Maybe a Source #