refact-0.3.0.2: Specify refactorings to perform with apply-refact
Safe HaskellSafe-Inferred
LanguageHaskell2010

Refact.Types

Synopsis

Documentation

data SrcSpan Source #

A generic SrcSpan, usually this is converted immediately to a native representation. (For example a GHC SrcSpan or a HSE SrcSpan)

Constructors

SrcSpan 

Fields

Instances

Instances details
Data SrcSpan Source # 
Instance details

Defined in Refact.Types

Methods

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

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

toConstr :: SrcSpan -> Constr

dataTypeOf :: SrcSpan -> DataType

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

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

gmapT :: (forall b. Data b => b -> b) -> SrcSpan -> SrcSpan

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

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

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

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

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

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

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

Read SrcSpan Source # 
Instance details

Defined in Refact.Types

Methods

readsPrec :: Int -> ReadS SrcSpan

readList :: ReadS [SrcSpan]

readPrec :: ReadPrec SrcSpan

readListPrec :: ReadPrec [SrcSpan]

Show SrcSpan Source # 
Instance details

Defined in Refact.Types

Methods

showsPrec :: Int -> SrcSpan -> ShowS

show :: SrcSpan -> String

showList :: [SrcSpan] -> ShowS

Eq SrcSpan Source # 
Instance details

Defined in Refact.Types

Methods

(==) :: SrcSpan -> SrcSpan -> Bool

(/=) :: SrcSpan -> SrcSpan -> Bool

Ord SrcSpan Source # 
Instance details

Defined in Refact.Types

Methods

compare :: SrcSpan -> SrcSpan -> Ordering

(<) :: SrcSpan -> SrcSpan -> Bool

(<=) :: SrcSpan -> SrcSpan -> Bool

(>) :: SrcSpan -> SrcSpan -> Bool

(>=) :: SrcSpan -> SrcSpan -> Bool

max :: SrcSpan -> SrcSpan -> SrcSpan

min :: SrcSpan -> SrcSpan -> SrcSpan

data RType Source #

Types of expressions which we are able to replace.

Instances

Instances details
Data RType Source # 
Instance details

Defined in Refact.Types

Methods

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

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

toConstr :: RType -> Constr

dataTypeOf :: RType -> DataType

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

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

gmapT :: (forall b. Data b => b -> b) -> RType -> RType

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

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

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

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

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

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

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

Read RType Source # 
Instance details

Defined in Refact.Types

Methods

readsPrec :: Int -> ReadS RType

readList :: ReadS [RType]

readPrec :: ReadPrec RType

readListPrec :: ReadPrec [RType]

Show RType Source # 
Instance details

Defined in Refact.Types

Methods

showsPrec :: Int -> RType -> ShowS

show :: RType -> String

showList :: [RType] -> ShowS

Eq RType Source # 
Instance details

Defined in Refact.Types

Methods

(==) :: RType -> RType -> Bool

(/=) :: RType -> RType -> Bool

Ord RType Source # 
Instance details

Defined in Refact.Types

Methods

compare :: RType -> RType -> Ordering

(<) :: RType -> RType -> Bool

(<=) :: RType -> RType -> Bool

(>) :: RType -> RType -> Bool

(>=) :: RType -> RType -> Bool

max :: RType -> RType -> RType

min :: RType -> RType -> RType

data Refactoring a Source #

Supported refactorings

Constructors

Replace 

Fields

  • rtype :: RType

    Type of expression to be replaced

  • pos :: a

    Expression to replace

  • subts :: [(String, a)]

    Substitutions to make

  • orig :: String

    Replacement template

ModifyComment 

Fields

InsertComment 

Fields

Delete 

Fields

  • rtype :: RType

    Type of expression to be replaced

  • pos :: a

    Expression to replace

RemoveAsKeyword

Takes the position of a import decl and removes the as keyword

Fields

  • pos :: a

    Expression to replace

Instances

Instances details
Functor Refactoring Source # 
Instance details

Defined in Refact.Types

Methods

fmap :: (a -> b) -> Refactoring a -> Refactoring b

(<$) :: a -> Refactoring b -> Refactoring a

Data a => Data (Refactoring a) Source # 
Instance details

Defined in Refact.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Refactoring a -> c (Refactoring a)

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Refactoring a)

toConstr :: Refactoring a -> Constr

dataTypeOf :: Refactoring a -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Refactoring a))

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

gmapT :: (forall b. Data b => b -> b) -> Refactoring a -> Refactoring a

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Refactoring a -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Refactoring a -> r

gmapQ :: (forall d. Data d => d -> u) -> Refactoring a -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> Refactoring a -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Refactoring a -> m (Refactoring a)

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Refactoring a -> m (Refactoring a)

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Refactoring a -> m (Refactoring a)

Read a => Read (Refactoring a) Source # 
Instance details

Defined in Refact.Types

Methods

readsPrec :: Int -> ReadS (Refactoring a)

readList :: ReadS [Refactoring a]

readPrec :: ReadPrec (Refactoring a)

readListPrec :: ReadPrec [Refactoring a]

Show a => Show (Refactoring a) Source # 
Instance details

Defined in Refact.Types

Methods

showsPrec :: Int -> Refactoring a -> ShowS

show :: Refactoring a -> String

showList :: [Refactoring a] -> ShowS

Eq a => Eq (Refactoring a) Source # 
Instance details

Defined in Refact.Types

Methods

(==) :: Refactoring a -> Refactoring a -> Bool

(/=) :: Refactoring a -> Refactoring a -> Bool

Ord a => Ord (Refactoring a) Source # 
Instance details

Defined in Refact.Types

Methods

compare :: Refactoring a -> Refactoring a -> Ordering

(<) :: Refactoring a -> Refactoring a -> Bool

(<=) :: Refactoring a -> Refactoring a -> Bool

(>) :: Refactoring a -> Refactoring a -> Bool

(>=) :: Refactoring a -> Refactoring a -> Bool

max :: Refactoring a -> Refactoring a -> Refactoring a

min :: Refactoring a -> Refactoring a -> Refactoring a