retrie-1.2.2: A powerful, easy-to-use codemodding tool for Haskell.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Retrie.Replace

Synopsis

Documentation

replace :: (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

Instances details
Show Replacement # 
Instance details

Defined in Retrie.Replace

Methods

showsPrec :: Int -> Replacement -> ShowS

show :: Replacement -> String

showList :: [Replacement] -> ShowS

data Change #

Used as the writer type during matching to indicate whether any change to the module should be made.

Instances

Instances details
Monoid Change # 
Instance details

Defined in Retrie.Replace

Semigroup Change # 
Instance details

Defined in Retrie.Replace

Methods

(<>) :: Change -> Change -> Change #

sconcat :: NonEmpty Change -> Change

stimes :: Integral b => b -> Change -> Change