    {-# LANGUAGE DeriveFunctor #-}
    {-# LANGUAGE DeriveDataTypeable #-}
    module Refact.Types where

    import Data.Data

    -- | A generic SrcSpan, usually this is converted immediately to a native
    -- representation. (For example a GHC SrcSpan or a HSE SrcSpan)
    data SrcSpan = SrcSpan
                    { SrcSpan -> Int
    startLine :: {-# UNPACK #-} !Int
                    , SrcSpan -> Int
    startCol  :: {-# UNPACK #-} !Int
                    , SrcSpan -> Int
    endLine   :: {-# UNPACK #-} !Int
                    , SrcSpan -> Int
    endCol    :: {-# UNPACK #-} !Int }
                    deriving (ReadPrec [SrcSpan]
    ReadPrec SrcSpan
    Int -> ReadS SrcSpan
    ReadS [SrcSpan]
    (Int -> ReadS SrcSpan)
    -> ReadS [SrcSpan]
    -> ReadPrec SrcSpan
    -> ReadPrec [SrcSpan]
    -> Read SrcSpan
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS SrcSpan
    readsPrec :: Int -> ReadS SrcSpan
    $creadList :: ReadS [SrcSpan]
    readList :: ReadS [SrcSpan]
    $creadPrec :: ReadPrec SrcSpan
    readPrec :: ReadPrec SrcSpan
    $creadListPrec :: ReadPrec [SrcSpan]
    readListPrec :: ReadPrec [SrcSpan]
    Read, Int -> SrcSpan -> ShowS
    [SrcSpan] -> ShowS
    SrcSpan -> String
    (Int -> SrcSpan -> ShowS)
    -> (SrcSpan -> String) -> ([SrcSpan] -> ShowS) -> Show SrcSpan
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> SrcSpan -> ShowS
    showsPrec :: Int -> SrcSpan -> ShowS
    $cshow :: SrcSpan -> String
    show :: SrcSpan -> String
    $cshowList :: [SrcSpan] -> ShowS
    showList :: [SrcSpan] -> ShowS
    Show, SrcSpan -> SrcSpan -> Bool
    (SrcSpan -> SrcSpan -> Bool)
    -> (SrcSpan -> SrcSpan -> Bool) -> Eq SrcSpan
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: SrcSpan -> SrcSpan -> Bool
    == :: SrcSpan -> SrcSpan -> Bool
    $c/= :: SrcSpan -> SrcSpan -> Bool
    /= :: SrcSpan -> SrcSpan -> Bool
    Eq, Eq SrcSpan
    Eq SrcSpan =>
    (SrcSpan -> SrcSpan -> Ordering)
    -> (SrcSpan -> SrcSpan -> Bool)
    -> (SrcSpan -> SrcSpan -> Bool)
    -> (SrcSpan -> SrcSpan -> Bool)
    -> (SrcSpan -> SrcSpan -> Bool)
    -> (SrcSpan -> SrcSpan -> SrcSpan)
    -> (SrcSpan -> SrcSpan -> SrcSpan)
    -> Ord SrcSpan
    SrcSpan -> SrcSpan -> Bool
    SrcSpan -> SrcSpan -> Ordering
    SrcSpan -> SrcSpan -> SrcSpan
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: SrcSpan -> SrcSpan -> Ordering
    compare :: SrcSpan -> SrcSpan -> Ordering
    $c< :: SrcSpan -> SrcSpan -> Bool
    < :: SrcSpan -> SrcSpan -> Bool
    $c<= :: SrcSpan -> SrcSpan -> Bool
    <= :: SrcSpan -> SrcSpan -> Bool
    $c> :: SrcSpan -> SrcSpan -> Bool
    > :: SrcSpan -> SrcSpan -> Bool
    $c>= :: SrcSpan -> SrcSpan -> Bool
    >= :: SrcSpan -> SrcSpan -> Bool
    $cmax :: SrcSpan -> SrcSpan -> SrcSpan
    max :: SrcSpan -> SrcSpan -> SrcSpan
    $cmin :: SrcSpan -> SrcSpan -> SrcSpan
    min :: SrcSpan -> SrcSpan -> SrcSpan
    Ord, Typeable SrcSpan
    Typeable SrcSpan =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> SrcSpan -> c SrcSpan)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c SrcSpan)
    -> (SrcSpan -> Constr)
    -> (SrcSpan -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c SrcSpan))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcSpan))
    -> ((forall b. Data b => b -> b) -> SrcSpan -> SrcSpan)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> SrcSpan -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> SrcSpan -> r)
    -> (forall u. (forall d. Data d => d -> u) -> SrcSpan -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> SrcSpan -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan)
    -> Data SrcSpan
    SrcSpan -> Constr
    SrcSpan -> DataType
    (forall b. Data b => b -> b) -> SrcSpan -> SrcSpan
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> SrcSpan -> u
    forall u. (forall d. Data d => d -> u) -> SrcSpan -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SrcSpan -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SrcSpan -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SrcSpan
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> SrcSpan -> c SrcSpan
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SrcSpan)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcSpan)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> SrcSpan -> c SrcSpan
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> SrcSpan -> c SrcSpan
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SrcSpan
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SrcSpan
    $ctoConstr :: SrcSpan -> Constr
    toConstr :: SrcSpan -> Constr
    $cdataTypeOf :: SrcSpan -> DataType
    dataTypeOf :: SrcSpan -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SrcSpan)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SrcSpan)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcSpan)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcSpan)
    $cgmapT :: (forall b. Data b => b -> b) -> SrcSpan -> SrcSpan
    gmapT :: (forall b. Data b => b -> b) -> SrcSpan -> SrcSpan
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SrcSpan -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SrcSpan -> r
    $cgmapQr :: forall r r'.
    (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
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> SrcSpan -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> SrcSpan -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SrcSpan -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SrcSpan -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
    Data, Typeable)

    -- | Types of expressions which we are able to replace.
    data RType = Expr | Decl | Type | Pattern | Stmt | ModuleName | Bind | Match | Import
               deriving (ReadPrec [RType]
    ReadPrec RType
    Int -> ReadS RType
    ReadS [RType]
    (Int -> ReadS RType)
    -> ReadS [RType]
    -> ReadPrec RType
    -> ReadPrec [RType]
    -> Read RType
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS RType
    readsPrec :: Int -> ReadS RType
    $creadList :: ReadS [RType]
    readList :: ReadS [RType]
    $creadPrec :: ReadPrec RType
    readPrec :: ReadPrec RType
    $creadListPrec :: ReadPrec [RType]
    readListPrec :: ReadPrec [RType]
    Read, Eq RType
    Eq RType =>
    (RType -> RType -> Ordering)
    -> (RType -> RType -> Bool)
    -> (RType -> RType -> Bool)
    -> (RType -> RType -> Bool)
    -> (RType -> RType -> Bool)
    -> (RType -> RType -> RType)
    -> (RType -> RType -> RType)
    -> Ord RType
    RType -> RType -> Bool
    RType -> RType -> Ordering
    RType -> RType -> RType
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: RType -> RType -> Ordering
    compare :: RType -> RType -> Ordering
    $c< :: RType -> RType -> Bool
    < :: RType -> RType -> Bool
    $c<= :: RType -> RType -> Bool
    <= :: RType -> RType -> Bool
    $c> :: RType -> RType -> Bool
    > :: RType -> RType -> Bool
    $c>= :: RType -> RType -> Bool
    >= :: RType -> RType -> Bool
    $cmax :: RType -> RType -> RType
    max :: RType -> RType -> RType
    $cmin :: RType -> RType -> RType
    min :: RType -> RType -> RType
    Ord, Int -> RType -> ShowS
    [RType] -> ShowS
    RType -> String
    (Int -> RType -> ShowS)
    -> (RType -> String) -> ([RType] -> ShowS) -> Show RType
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> RType -> ShowS
    showsPrec :: Int -> RType -> ShowS
    $cshow :: RType -> String
    show :: RType -> String
    $cshowList :: [RType] -> ShowS
    showList :: [RType] -> ShowS
    Show, RType -> RType -> Bool
    (RType -> RType -> Bool) -> (RType -> RType -> Bool) -> Eq RType
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: RType -> RType -> Bool
    == :: RType -> RType -> Bool
    $c/= :: RType -> RType -> Bool
    /= :: RType -> RType -> Bool
    Eq, Typeable RType
    Typeable RType =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> RType -> c RType)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c RType)
    -> (RType -> Constr)
    -> (RType -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c RType))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RType))
    -> ((forall b. Data b => b -> b) -> RType -> RType)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RType -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RType -> r)
    -> (forall u. (forall d. Data d => d -> u) -> RType -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> RType -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> RType -> m RType)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> RType -> m RType)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> RType -> m RType)
    -> Data RType
    RType -> Constr
    RType -> DataType
    (forall b. Data b => b -> b) -> RType -> RType
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> RType -> u
    forall u. (forall d. Data d => d -> u) -> RType -> [u]
    forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RType -> r
    forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RType -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> RType -> m RType
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RType -> m RType
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RType
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RType -> c RType
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RType)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RType)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RType -> c RType
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RType -> c RType
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RType
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RType
    $ctoConstr :: RType -> Constr
    toConstr :: RType -> Constr
    $cdataTypeOf :: RType -> DataType
    dataTypeOf :: RType -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RType)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RType)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RType)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RType)
    $cgmapT :: (forall b. Data b => b -> b) -> RType -> RType
    gmapT :: (forall b. Data b => b -> b) -> RType -> RType
    $cgmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RType -> r
    gmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RType -> r
    $cgmapQr :: forall r r'.
    (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
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> RType -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> RType -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RType -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RType -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> RType -> m RType
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> RType -> m RType
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RType -> m RType
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RType -> m RType
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RType -> m RType
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RType -> m RType
    Data, Typeable)

    -- | Supported refactorings
    data Refactoring a =
      Replace  {
          forall a. Refactoring a -> RType
    rtype :: RType -- ^ Type of expression to be replaced
        , forall a. Refactoring a -> a
    pos :: a  -- ^ Expression to replace
        , forall a. Refactoring a -> [(String, a)]
    subts :: [(String, a)] -- ^ Substitutions to make
        , forall a. Refactoring a -> String
    orig  :: String -- ^ Replacement template
        }
      | ModifyComment {
          pos :: a
        , forall a. Refactoring a -> String
    newComment :: String
        }
      | InsertComment {
          pos :: a
        , newComment :: String
        }
      | Delete {
          rtype :: RType
        , pos :: a
        }

      | -- |  Takes the position of a import decl and removes the as keyword
        RemoveAsKeyword
          {
          pos :: a
          }
    --  | Rename {
    --      nameSubts :: [(String, String)]
    --    }
      deriving (Int -> Refactoring a -> ShowS
    [Refactoring a] -> ShowS
    Refactoring a -> String
    (Int -> Refactoring a -> ShowS)
    -> (Refactoring a -> String)
    -> ([Refactoring a] -> ShowS)
    -> Show (Refactoring a)
    forall a. Show a => Int -> Refactoring a -> ShowS
    forall a. Show a => [Refactoring a] -> ShowS
    forall a. Show a => Refactoring a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Refactoring a -> ShowS
    showsPrec :: Int -> Refactoring a -> ShowS
    $cshow :: forall a. Show a => Refactoring a -> String
    show :: Refactoring a -> String
    $cshowList :: forall a. Show a => [Refactoring a] -> ShowS
    showList :: [Refactoring a] -> ShowS
    Show, ReadPrec [Refactoring a]
    ReadPrec (Refactoring a)
    Int -> ReadS (Refactoring a)
    ReadS [Refactoring a]
    (Int -> ReadS (Refactoring a))
    -> ReadS [Refactoring a]
    -> ReadPrec (Refactoring a)
    -> ReadPrec [Refactoring a]
    -> Read (Refactoring a)
    forall a. Read a => ReadPrec [Refactoring a]
    forall a. Read a => ReadPrec (Refactoring a)
    forall a. Read a => Int -> ReadS (Refactoring a)
    forall a. Read a => ReadS [Refactoring a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Refactoring a)
    readsPrec :: Int -> ReadS (Refactoring a)
    $creadList :: forall a. Read a => ReadS [Refactoring a]
    readList :: ReadS [Refactoring a]
    $creadPrec :: forall a. Read a => ReadPrec (Refactoring a)
    readPrec :: ReadPrec (Refactoring a)
    $creadListPrec :: forall a. Read a => ReadPrec [Refactoring a]
    readListPrec :: ReadPrec [Refactoring a]
    Read, (forall a b. (a -> b) -> Refactoring a -> Refactoring b)
    -> (forall a b. a -> Refactoring b -> Refactoring a)
    -> Functor Refactoring
    forall a b. a -> Refactoring b -> Refactoring a
    forall a b. (a -> b) -> Refactoring a -> Refactoring b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b. (a -> b) -> Refactoring a -> Refactoring b
    fmap :: forall a b. (a -> b) -> Refactoring a -> Refactoring b
    $c<$ :: forall a b. a -> Refactoring b -> Refactoring a
    <$ :: forall a b. a -> Refactoring b -> Refactoring a
    Functor, Refactoring a -> Refactoring a -> Bool
    (Refactoring a -> Refactoring a -> Bool)
    -> (Refactoring a -> Refactoring a -> Bool) -> Eq (Refactoring a)
    forall a. Eq a => Refactoring a -> Refactoring a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Refactoring a -> Refactoring a -> Bool
    == :: Refactoring a -> Refactoring a -> Bool
    $c/= :: forall a. Eq a => Refactoring a -> Refactoring a -> Bool
    /= :: Refactoring a -> Refactoring a -> Bool
    Eq, Eq (Refactoring a)
    Eq (Refactoring a) =>
    (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)
    -> (Refactoring a -> Refactoring a -> Refactoring a)
    -> (Refactoring a -> Refactoring a -> Refactoring a)
    -> Ord (Refactoring a)
    Refactoring a -> Refactoring a -> Bool
    Refactoring a -> Refactoring a -> Ordering
    Refactoring a -> Refactoring a -> Refactoring a
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall a. Ord a => Eq (Refactoring a)
    forall a. Ord a => Refactoring a -> Refactoring a -> Bool
    forall a. Ord a => Refactoring a -> Refactoring a -> Ordering
    forall a. Ord a => Refactoring a -> Refactoring a -> Refactoring a
    $ccompare :: forall a. Ord a => Refactoring a -> Refactoring a -> Ordering
    compare :: Refactoring a -> Refactoring a -> Ordering
    $c< :: forall a. Ord a => Refactoring a -> Refactoring a -> Bool
    < :: Refactoring a -> Refactoring a -> Bool
    $c<= :: forall a. Ord a => Refactoring a -> Refactoring a -> Bool
    <= :: Refactoring a -> Refactoring a -> Bool
    $c> :: forall a. Ord a => Refactoring a -> Refactoring a -> Bool
    > :: Refactoring a -> Refactoring a -> Bool
    $c>= :: forall a. Ord a => Refactoring a -> Refactoring a -> Bool
    >= :: Refactoring a -> Refactoring a -> Bool
    $cmax :: forall a. Ord a => Refactoring a -> Refactoring a -> Refactoring a
    max :: Refactoring a -> Refactoring a -> Refactoring a
    $cmin :: forall a. Ord a => Refactoring a -> Refactoring a -> Refactoring a
    min :: Refactoring a -> Refactoring a -> Refactoring a
    Ord, Typeable (Refactoring a)
    Typeable (Refactoring a) =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> Refactoring a -> c (Refactoring a))
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c (Refactoring a))
    -> (Refactoring a -> Constr)
    -> (Refactoring a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c (Refactoring a)))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c (Refactoring a)))
    -> ((forall b. Data b => b -> b) -> Refactoring a -> Refactoring a)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> Refactoring a -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> Refactoring a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> Refactoring a -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> Refactoring a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d)
        -> Refactoring a -> m (Refactoring a))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d)
        -> Refactoring a -> m (Refactoring a))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d)
        -> Refactoring a -> m (Refactoring a))
    -> Data (Refactoring a)
    Refactoring a -> Constr
    Refactoring a -> DataType
    (forall b. Data b => b -> b) -> Refactoring a -> Refactoring a
    forall a. Data a => Typeable (Refactoring a)
    forall a. Data a => Refactoring a -> Constr
    forall a. Data a => Refactoring a -> DataType
    forall a.
    Data a =>
    (forall b. Data b => b -> b) -> Refactoring a -> Refactoring a
    forall a u.
    Data a =>
    Int -> (forall d. Data d => d -> u) -> Refactoring a -> u
    forall a u.
    Data a =>
    (forall d. Data d => d -> u) -> Refactoring a -> [u]
    forall a r r'.
    Data a =>
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Refactoring a -> r
    forall a r r'.
    Data a =>
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Refactoring a -> r
    forall a (m :: * -> *).
    (Data a, Monad m) =>
    (forall d. Data d => d -> m d)
    -> Refactoring a -> m (Refactoring a)
    forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d)
    -> Refactoring a -> m (Refactoring a)
    forall a (c :: * -> *).
    Data a =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Refactoring a)
    forall a (c :: * -> *).
    Data a =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Refactoring a -> c (Refactoring a)
    forall a (t :: * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (Refactoring a))
    forall a (t :: * -> * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Refactoring a))
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> Refactoring a -> u
    forall u. (forall d. Data d => d -> u) -> Refactoring a -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Refactoring a -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Refactoring a -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> Refactoring a -> m (Refactoring a)
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> Refactoring a -> m (Refactoring a)
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Refactoring a)
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Refactoring a -> c (Refactoring a)
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Refactoring a))
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Refactoring a))
    $cgfoldl :: forall a (c :: * -> *).
    Data a =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Refactoring a -> c (Refactoring a)
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Refactoring a -> c (Refactoring a)
    $cgunfold :: forall a (c :: * -> *).
    Data a =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Refactoring a)
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Refactoring a)
    $ctoConstr :: forall a. Data a => Refactoring a -> Constr
    toConstr :: Refactoring a -> Constr
    $cdataTypeOf :: forall a. Data a => Refactoring a -> DataType
    dataTypeOf :: Refactoring a -> DataType
    $cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (Refactoring a))
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Refactoring a))
    $cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Refactoring a))
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Refactoring a))
    $cgmapT :: forall a.
    Data a =>
    (forall b. Data b => b -> b) -> Refactoring a -> Refactoring a
    gmapT :: (forall b. Data b => b -> b) -> Refactoring a -> Refactoring a
    $cgmapQl :: forall a r r'.
    Data a =>
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Refactoring a -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Refactoring a -> r
    $cgmapQr :: forall a r r'.
    Data a =>
    (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
    $cgmapQ :: forall a u.
    Data a =>
    (forall d. Data d => d -> u) -> Refactoring a -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> Refactoring a -> [u]
    $cgmapQi :: forall a u.
    Data a =>
    Int -> (forall d. Data d => d -> u) -> Refactoring a -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Refactoring a -> u
    $cgmapM :: forall a (m :: * -> *).
    (Data a, Monad m) =>
    (forall d. Data d => d -> m d)
    -> Refactoring a -> m (Refactoring a)
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> Refactoring a -> m (Refactoring a)
    $cgmapMp :: forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d)
    -> Refactoring a -> m (Refactoring a)
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> Refactoring a -> m (Refactoring a)
    $cgmapMo :: forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d)
    -> Refactoring a -> m (Refactoring a)
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> Refactoring a -> m (Refactoring a)
    Data, Typeable )