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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Retrie.Universe

Synopsis

- data Universe
- printU :: Annotated Universe -> String
- class Matchable ast where
  - inject :: ast -> Universe
  - project :: Universe -> ast
  - getOrigin :: ast -> SrcSpan
- data UMap a = UMap {
  - umExpr :: EMap a
  - umStmt :: SMap a
  - umType :: TyMap a
  - umPat :: PatMap a
  }

# Documentation

data Universe #

A sum type to collect all possible top-level rewritable types.

#### Instances

Instances details

Data Universe # |

Instance details

Defined in Retrie.Universe

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Universe -> c Universe #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Universe #

toConstr :: Universe -> Constr #

dataTypeOf :: Universe -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Universe) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Universe) #

gmapT :: (forall b. Data b => b -> b) -> Universe -> Universe #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Universe -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Universe -> r #

gmapQ :: (forall d. Data d => d -> u) -> Universe -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Universe -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Universe -> m Universe #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Universe -> m Universe #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Universe -> m Universe #

Matchable Universe # |
Instance details Defined in Retrie.Universe Methods inject :: Universe -> Universe # project :: Universe -> Universe # getOrigin :: Universe -> SrcSpan #

printU :: Annotated Universe -> String #

Exactprint an annotated `Universe`.

class Matchable ast where #

Class of types which can be injected into the `Universe` type.

Methods

inject :: ast -> Universe #

Inject an AST into `Universe`

project :: Universe -> ast #

Project an AST from a `Universe`. Can fail if universe contains the wrong type.

getOrigin :: ast -> SrcSpan #

Get the original location of the AST.

#### Instances

Instances details

Matchable Universe # |
Instance details Defined in Retrie.Universe Methods inject :: Universe -> Universe # project :: Universe -> Universe # getOrigin :: Universe -> SrcSpan #
Matchable (LocatedA (HsExpr GhcPs)) # |
Instance details Defined in Retrie.Universe Methods inject :: LocatedA (HsExpr GhcPs) -> Universe # project :: Universe -> LocatedA (HsExpr GhcPs) # getOrigin :: LocatedA (HsExpr GhcPs) -> SrcSpan #
Matchable (LocatedA (Stmt GhcPs (LocatedA (HsExpr GhcPs)))) # |
Instance details Defined in Retrie.Universe Methods inject :: LocatedA (Stmt GhcPs (LocatedA (HsExpr GhcPs))) -> Universe # project :: Universe -> LocatedA (Stmt GhcPs (LocatedA (HsExpr GhcPs))) # getOrigin :: LocatedA (Stmt GhcPs (LocatedA (HsExpr GhcPs))) -> SrcSpan #
Matchable (LocatedA (Pat GhcPs)) # |
Instance details Defined in Retrie.Universe Methods inject :: LocatedA (Pat GhcPs) -> Universe # project :: Universe -> LocatedA (Pat GhcPs) # getOrigin :: LocatedA (Pat GhcPs) -> SrcSpan #
Matchable (LocatedA (HsType GhcPs)) # |
Instance details Defined in Retrie.Universe Methods inject :: LocatedA (HsType GhcPs) -> Universe # project :: Universe -> LocatedA (HsType GhcPs) # getOrigin :: LocatedA (HsType GhcPs) -> SrcSpan #

data UMap a #

The pattern map for `Universe`.

Constructors

UMap |

Fields

- umExpr :: EMap a
- umStmt :: SMap a
- umType :: TyMap a
- umPat :: PatMap a

#### Instances

Instances details

Functor UMap # |
Instance details Defined in Retrie.Universe Methods fmap :: (a -> b) -> UMap a -> UMap b # (<$) :: a -> UMap b -> UMap 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)] #
type Key UMap # |
Instance details Defined in Retrie.Universe type Key UMap = Universe