Safe Haskell | None |
---|---|
Language | Haskell2010 |
Retrie.Replace
Synopsis
- replace :: forall a (m :: Type -> Type). (Data a, MonadIO m) => Context -> a -> TransformT (WriterT Change m) a
- data Replacement = Replacement {}
- data Change
Documentation
replace :: forall a (m :: Type -> Type). (Data a, MonadIO m) => Context -> a -> TransformT (WriterT Change m) a #
Specializes replaceImpl
to each of the AST types that retrie supports.
data Replacement #
Records a replacement made. In cases where we cannot use ghc-exactprint to print the resulting AST (e.g. CPP modules), we fall back on splicing strings. Can also be used by external tools (search, linters, etc).
Constructors
Replacement | |
Fields |
Instances
Show Replacement # | |
Defined in Retrie.Replace Methods showsPrec :: Int -> Replacement -> ShowS # show :: Replacement -> String # showList :: [Replacement] -> ShowS # |
Used as the writer type during matching to indicate whether any change to the module should be made.
Constructors
NoChange | |
Change [Replacement] [AnnotatedImports] |