retrie-1.2.2: A powerful, easy-to-use codemodding tool for Haskell.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Retrie.PatternMap.Class

# Documentation

data MatchEnv #

Constructors

ME |

Fields

- meAlphaEnv :: AlphaEnv
- mePruneA :: forall a. a -> Annotated a

extendMatchEnv :: MatchEnv -> [RdrName] -> MatchEnv #

pruneMatchEnv :: Int -> MatchEnv -> MatchEnv #

type A a = Maybe a -> Maybe a #

toA :: PatternMap m => (m a -> m a) -> A (m a) #

toAList :: A a -> A [a] #

unionOn :: PatternMap m => (a -> m b) -> a -> a -> m b #

class PatternMap m where #

Associated Types

type Key m :: Type #

Methods

mEmpty :: m a #

mUnion :: m a -> m a -> m a #

mAlter :: AlphaEnv -> Quantifiers -> Key m -> A a -> m a -> m a #

mMatch :: MatchEnv -> Key m -> (Substitution, m a) -> [(Substitution, a)] #

#### Instances

Instances details

PatternMap BoolMap # |
Instance details Defined in Retrie.PatternMap.Bag Associated Types type Key BoolMap # Methods mEmpty :: BoolMap a # mUnion :: BoolMap a -> BoolMap a -> BoolMap a # mAlter :: AlphaEnv -> Quantifiers -> Key BoolMap -> A a -> BoolMap a -> BoolMap a # mMatch :: MatchEnv -> Key BoolMap -> (Substitution, BoolMap a) -> [(Substitution, a)] #
PatternMap FSEnv # |
Instance details Defined in Retrie.PatternMap.Bag Associated Types type Key FSEnv # Methods mEmpty :: FSEnv a # mUnion :: FSEnv a -> FSEnv a -> FSEnv a # mAlter :: AlphaEnv -> Quantifiers -> Key FSEnv -> A a -> FSEnv a -> FSEnv a # mMatch :: MatchEnv -> Key FSEnv -> (Substitution, FSEnv a) -> [(Substitution, a)] #
PatternMap IntMap # |
Instance details Defined in Retrie.PatternMap.Bag Associated Types type Key IntMap # Methods mEmpty :: IntMap a # mUnion :: IntMap a -> IntMap a -> IntMap a # mAlter :: AlphaEnv -> Quantifiers -> Key IntMap -> A a -> IntMap a -> IntMap a # mMatch :: MatchEnv -> Key IntMap -> (Substitution, IntMap a) -> [(Substitution, a)] #
PatternMap UniqFM # |
Instance details Defined in Retrie.PatternMap.Bag Associated Types type Key UniqFM # Methods mEmpty :: UniqFM a # mUnion :: UniqFM a -> UniqFM a -> UniqFM a # mAlter :: AlphaEnv -> Quantifiers -> Key UniqFM -> A a -> UniqFM a -> UniqFM a # mMatch :: MatchEnv -> Key UniqFM -> (Substitution, UniqFM a) -> [(Substitution, a)] #
PatternMap MaybeMap # |
Instance details Defined in Retrie.PatternMap.Class Associated Types type Key MaybeMap # Methods mEmpty :: MaybeMap a # mUnion :: MaybeMap a -> MaybeMap a -> MaybeMap a # mAlter :: AlphaEnv -> Quantifiers -> Key MaybeMap -> A a -> MaybeMap a -> MaybeMap a # mMatch :: MatchEnv -> Key MaybeMap -> (Substitution, MaybeMap a) -> [(Substitution, a)] #
PatternMap BMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key BMap # Methods mEmpty :: BMap a # mUnion :: BMap a -> BMap a -> BMap a # mAlter :: AlphaEnv -> Quantifiers -> Key BMap -> A a -> BMap a -> BMap a # mMatch :: MatchEnv -> Key BMap -> (Substitution, BMap a) -> [(Substitution, a)] #
PatternMap BoxityMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key BoxityMap # Methods mEmpty :: BoxityMap a # mUnion :: BoxityMap a -> BoxityMap a -> BoxityMap a # mAlter :: AlphaEnv -> Quantifiers -> Key BoxityMap -> A a -> BoxityMap a -> BoxityMap a # mMatch :: MatchEnv -> Key BoxityMap -> (Substitution, BoxityMap a) -> [(Substitution, a)] #
PatternMap CDMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key CDMap # Methods mEmpty :: CDMap a # mUnion :: CDMap a -> CDMap a -> CDMap a # mAlter :: AlphaEnv -> Quantifiers -> Key CDMap -> A a -> CDMap a -> CDMap a # mMatch :: MatchEnv -> Key CDMap -> (Substitution, CDMap a) -> [(Substitution, a)] #
PatternMap EMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key EMap # Methods mEmpty :: EMap a # mUnion :: EMap a -> EMap a -> EMap a # mAlter :: AlphaEnv -> Quantifiers -> Key EMap -> A a -> EMap a -> EMap a # mMatch :: MatchEnv -> Key EMap -> (Substitution, EMap a) -> [(Substitution, a)] #
PatternMap ForAllTyMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key ForAllTyMap # Methods mEmpty :: ForAllTyMap a # mUnion :: ForAllTyMap a -> ForAllTyMap a -> ForAllTyMap a # mAlter :: AlphaEnv -> Quantifiers -> Key ForAllTyMap -> A a -> ForAllTyMap a -> ForAllTyMap a # mMatch :: MatchEnv -> Key ForAllTyMap -> (Substitution, ForAllTyMap a) -> [(Substitution, a)] #
PatternMap ForallVisMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key ForallVisMap # Methods mEmpty :: ForallVisMap a # mUnion :: ForallVisMap a -> ForallVisMap a -> ForallVisMap a # mAlter :: AlphaEnv -> Quantifiers -> Key ForallVisMap -> A a -> ForallVisMap a -> ForallVisMap a # mMatch :: MatchEnv -> Key ForallVisMap -> (Substitution, ForallVisMap a) -> [(Substitution, a)] #
PatternMap GRHSMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key GRHSMap # Methods mEmpty :: GRHSMap a # mUnion :: GRHSMap a -> GRHSMap a -> GRHSMap a # mAlter :: AlphaEnv -> Quantifiers -> Key GRHSMap -> A a -> GRHSMap a -> GRHSMap a # mMatch :: MatchEnv -> Key GRHSMap -> (Substitution, GRHSMap a) -> [(Substitution, a)] #
PatternMap GRHSSMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key GRHSSMap # Methods mEmpty :: GRHSSMap a # mUnion :: GRHSSMap a -> GRHSSMap a -> GRHSSMap a # mAlter :: AlphaEnv -> Quantifiers -> Key GRHSSMap -> A a -> GRHSSMap a -> GRHSSMap a # mMatch :: MatchEnv -> Key GRHSSMap -> (Substitution, GRHSSMap a) -> [(Substitution, a)] #
PatternMap LBMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key LBMap # Methods mEmpty :: LBMap a # mUnion :: LBMap a -> LBMap a -> LBMap a # mAlter :: AlphaEnv -> Quantifiers -> Key LBMap -> A a -> LBMap a -> LBMap a # mMatch :: MatchEnv -> Key LBMap -> (Substitution, LBMap a) -> [(Substitution, a)] #
PatternMap LMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key LMap # Methods mEmpty :: LMap a # mUnion :: LMap a -> LMap a -> LMap a # mAlter :: AlphaEnv -> Quantifiers -> Key LMap -> A a -> LMap a -> LMap a # mMatch :: MatchEnv -> Key LMap -> (Substitution, LMap a) -> [(Substitution, a)] #
PatternMap MGMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key MGMap # Methods mEmpty :: MGMap a # mUnion :: MGMap a -> MGMap a -> MGMap a # mAlter :: AlphaEnv -> Quantifiers -> Key MGMap -> A a -> MGMap a -> MGMap a # mMatch :: MatchEnv -> Key MGMap -> (Substitution, MGMap a) -> [(Substitution, a)] #
PatternMap MMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key MMap # Methods mEmpty :: MMap a # mUnion :: MMap a -> MMap a -> MMap a # mAlter :: AlphaEnv -> Quantifiers -> Key MMap -> A a -> MMap a -> MMap a # mMatch :: MatchEnv -> Key MMap -> (Substitution, MMap a) -> [(Substitution, a)] #
PatternMap OLMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key OLMap # Methods mEmpty :: OLMap a # mUnion :: OLMap a -> OLMap a -> OLMap a # mAlter :: AlphaEnv -> Quantifiers -> Key OLMap -> A a -> OLMap a -> OLMap a # mMatch :: MatchEnv -> Key OLMap -> (Substitution, OLMap a) -> [(Substitution, a)] #
PatternMap PatMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key PatMap # Methods mEmpty :: PatMap a # mUnion :: PatMap a -> PatMap a -> PatMap a # mAlter :: AlphaEnv -> Quantifiers -> Key PatMap -> A a -> PatMap a -> PatMap a # mMatch :: MatchEnv -> Key PatMap -> (Substitution, PatMap a) -> [(Substitution, a)] #
PatternMap RFMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key RFMap # Methods mEmpty :: RFMap a # mUnion :: RFMap a -> RFMap a -> RFMap a # mAlter :: AlphaEnv -> Quantifiers -> Key RFMap -> A a -> RFMap a -> RFMap a # mMatch :: MatchEnv -> Key RFMap -> (Substitution, RFMap a) -> [(Substitution, a)] #
PatternMap SCMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key SCMap # Methods mEmpty :: SCMap a # mUnion :: SCMap a -> SCMap a -> SCMap a # mAlter :: AlphaEnv -> Quantifiers -> Key SCMap -> A a -> SCMap a -> SCMap a # mMatch :: MatchEnv -> Key SCMap -> (Substitution, SCMap a) -> [(Substitution, a)] #
PatternMap SLMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key SLMap # Methods mEmpty :: SLMap a # mUnion :: SLMap a -> SLMap a -> SLMap a # mAlter :: AlphaEnv -> Quantifiers -> Key SLMap -> A a -> SLMap a -> SLMap a # mMatch :: MatchEnv -> Key SLMap -> (Substitution, SLMap a) -> [(Substitution, a)] #
PatternMap SMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key SMap # Methods mEmpty :: SMap a # mUnion :: SMap a -> SMap a -> SMap a # mAlter :: AlphaEnv -> Quantifiers -> Key SMap -> A a -> SMap a -> SMap a # mMatch :: MatchEnv -> Key SMap -> (Substitution, SMap a) -> [(Substitution, a)] #
PatternMap TupArgMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key TupArgMap # Methods mEmpty :: TupArgMap a # mUnion :: TupArgMap a -> TupArgMap a -> TupArgMap a # mAlter :: AlphaEnv -> Quantifiers -> Key TupArgMap -> A a -> TupArgMap a -> TupArgMap a # mMatch :: MatchEnv -> Key TupArgMap -> (Substitution, TupArgMap a) -> [(Substitution, a)] #
PatternMap TupleSortMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key TupleSortMap # Methods mEmpty :: TupleSortMap a # mUnion :: TupleSortMap a -> TupleSortMap a -> TupleSortMap a # mAlter :: AlphaEnv -> Quantifiers -> Key TupleSortMap -> A a -> TupleSortMap a -> TupleSortMap a # mMatch :: MatchEnv -> Key TupleSortMap -> (Substitution, TupleSortMap a) -> [(Substitution, a)] #
PatternMap TyMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key TyMap # Methods mEmpty :: TyMap a # mUnion :: TyMap a -> TyMap a -> TyMap a # mAlter :: AlphaEnv -> Quantifiers -> Key TyMap -> A a -> TyMap a -> TyMap a # mMatch :: MatchEnv -> Key TyMap -> (Substitution, TyMap a) -> [(Substitution, a)] #
PatternMap VMap # |
Instance details Defined in Retrie.PatternMap.Instances Associated Types type Key VMap # Methods mEmpty :: VMap a # mUnion :: VMap a -> VMap a -> VMap a # mAlter :: AlphaEnv -> Quantifiers -> Key VMap -> A a -> VMap a -> VMap a # mMatch :: MatchEnv -> Key VMap -> (Substitution, VMap a) -> [(Substitution, a)] #
PatternMap UMap # |
Instance details Defined in Retrie.Universe Associated Types type Key UMap # Methods mEmpty :: UMap a # mUnion :: UMap a -> UMap a -> UMap a # mAlter :: AlphaEnv -> Quantifiers -> Key UMap -> A a -> UMap a -> UMap a # mMatch :: MatchEnv -> Key UMap -> (Substitution, UMap a) -> [(Substitution, a)] #
Ord k => PatternMap (Map k) # |
Instance details Defined in Retrie.PatternMap.Bag Associated Types type Key (Map k) # Methods mEmpty :: Map k a # mUnion :: Map k a -> Map k a -> Map k a # mAlter :: AlphaEnv -> Quantifiers -> Key (Map k) -> A a -> Map k a -> Map k a # mMatch :: MatchEnv -> Key (Map k) -> (Substitution, Map k a) -> [(Substitution, a)] #
PatternMap m => PatternMap (ListMap m) # |
Instance details Defined in Retrie.PatternMap.Class Associated Types type Key (ListMap m) # Methods mEmpty :: ListMap m a # mUnion :: ListMap m a -> ListMap m a -> ListMap m a # mAlter :: AlphaEnv -> Quantifiers -> Key (ListMap m) -> A a -> ListMap m a -> ListMap m a # mMatch :: MatchEnv -> Key (ListMap m) -> (Substitution, ListMap m a) -> [(Substitution, a)] #

mapFor :: (b -> c) -> (a, b) -> [(a, c)] #

maybeMap :: (b -> Maybe c) -> (a, b) -> [(a, c)] #

maybeListMap :: (b -> Maybe [c]) -> (a, b) -> [(a, c)] #

newtype MaybeMap a #

Constructors

MaybeMap [a] |

#### Instances

Instances details

Functor MaybeMap # |
Instance details Defined in Retrie.PatternMap.Class Methods fmap :: (a -> b) -> MaybeMap a -> MaybeMap b # (<$) :: a -> MaybeMap b -> MaybeMap a #
PatternMap MaybeMap # |
Instance details Defined in Retrie.PatternMap.Class Associated Types type Key MaybeMap # Methods mEmpty :: MaybeMap a # mUnion :: MaybeMap a -> MaybeMap a -> MaybeMap a # mAlter :: AlphaEnv -> Quantifiers -> Key MaybeMap -> A a -> MaybeMap a -> MaybeMap a # mMatch :: MatchEnv -> Key MaybeMap -> (Substitution, MaybeMap a) -> [(Substitution, a)] #
type Key MaybeMap # |
Instance details Defined in Retrie.PatternMap.Class type Key MaybeMap = ()

data ListMap m a #

Constructors

ListMap |

Fields

- lmNil :: MaybeMap a
- lmCons :: m (ListMap m a)

#### Instances

Instances details

Functor m => Functor (ListMap m) # |
Instance details Defined in Retrie.PatternMap.Class Methods fmap :: (a -> b) -> ListMap m a -> ListMap m b # (<$) :: a -> ListMap m b -> ListMap m a #
PatternMap m => PatternMap (ListMap m) # |
Instance details Defined in Retrie.PatternMap.Class Associated Types type Key (ListMap m) # Methods mEmpty :: ListMap m a # mUnion :: ListMap m a -> ListMap m a -> ListMap m a # mAlter :: AlphaEnv -> Quantifiers -> Key (ListMap m) -> A a -> ListMap m a -> ListMap m a # mMatch :: MatchEnv -> Key (ListMap m) -> (Substitution, ListMap m a) -> [(Substitution, a)] #
type Key (ListMap m) # |
Instance details Defined in Retrie.PatternMap.Class type Key (ListMap m) = [Key m]

findMatch :: PatternMap m => MatchEnv -> Key m -> m a -> [(Substitution, a)] #

insertMatch :: PatternMap m => AlphaEnv -> Quantifiers -> Key m -> a -> m a -> m a #