reprinter-0.1.0.0: Scrap Your Reprinter

Safe HaskellNone
LanguageHaskell2010

Text.Reprinter

Synopsis

Documentation

reprint :: (Monad m, Data p) => Reprinting m -> p -> Source -> m Source Source #

The reprint algorithm takes a refactoring (parameteric in | some monad m) and turns an arbitrary pretty-printable type p | into a monadic Source transformer.

splitBySpan :: (Position, Position) -> Source -> (Source, Source) Source #

Given a lower-bound and upper-bound pair of Positions, split the | incoming Source based on the distanceF between the Position pairs

data Position Source #

Constructors

Position 

Fields

Instances

Data Position Source # 

Methods

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

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

toConstr :: Position -> Constr #

dataTypeOf :: Position -> DataType #

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

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

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

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

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

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

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

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

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

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

Show Position Source # 

type Reprinting m = forall b. Typeable b => b -> m (Maybe (RefactorType, Source, (Position, Position))) Source #

catchAll :: Monad m => a -> m (Maybe b) Source #

Catch all generic query

genReprinting :: (Monad m, Refactorable t, Typeable t) => (t -> m Source) -> t -> m (Maybe (RefactorType, Source, (Position, Position))) Source #

Essentially wraps the refactorable interface

class Refactorable t where Source #

Infrastructure for building the reprinter "plugins"

Minimal complete definition

isRefactored, getSpan

data RefactorType Source #

Specify a refactoring type

Constructors

Before 
After 
Replace