Safe Haskell | None |
---|---|

Language | Haskell2010 |

- reprint :: (Monad m, Data p) => Reprinting m -> p -> Source -> m Source
- splitBySpan :: (Position, Position) -> Source -> (Source, Source)
- data Position = Position {}
- type Source = ByteString
- type Reprinting m = forall b. Typeable b => b -> m (Maybe (RefactorType, Source, (Position, Position)))
- initPosition :: Position
- catchAll :: Monad m => a -> m (Maybe b)
- genReprinting :: (Monad m, Refactorable t, Typeable t) => (t -> m Source) -> t -> m (Maybe (RefactorType, Source, (Position, Position)))
- class Refactorable t where
- data RefactorType

# 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

type Source = ByteString Source #

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

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"

isRefactored :: t -> Maybe RefactorType Source #