Refact.Types

refact-0.3.0.2: Specify refactorings to perform with apply-refact

Safe Haskell | Safe
Language | Haskell2010

Refact.Types

Synopsis

- data SrcSpan = SrcSpan {
  - startLine :: !Int
  - startCol :: !Int
  - endLine :: !Int
  - endCol :: !Int
  }
- data RType
  - = Expr
  - | Decl
  - | Type
  - | Pattern
  - | Stmt
  - | ModuleName
  - | Bind
  - | Match
  - | Import
- data Refactoring a
  - = Replace {
    - rtype :: RType
    - pos :: a
    - subts :: [(String, a)]
    - orig :: String
    }
  - | ModifyComment {
    - pos :: a
    - newComment :: String
    }
  - | InsertComment {
    - pos :: a
    - newComment :: String
    }
  - | Delete {
    - rtype :: RType
    - pos :: a
    }
  - | RemoveAsKeyword {
    - pos :: a
    }

# Documentation

data SrcSpan

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

Constructors

SrcSpan |
Fields startLine :: !Int startCol :: !Int endLine :: !Int endCol :: !Int

Instances

Eq SrcSpan |
Data SrcSpan |
Ord SrcSpan |
Read SrcSpan |
Show SrcSpan |

data RType

Types of expressions which we are able to replace.

Constructors

Expr |
Decl |
Type |
Pattern |
Stmt |
ModuleName |
Bind |
Match |
Import |

Instances

Eq RType |
Data RType |
Ord RType |
Read RType |
Show RType |

data Refactoring a

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 pos :: a Expression to replace newComment :: String
InsertComment |
Fields pos :: a Expression to replace newComment :: String
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

Functor Refactoring |
Eq a => Eq (Refactoring a) |
Data a => Data (Refactoring a) |
Ord a => Ord (Refactoring a) |
Read a => Read (Refactoring a) |
Show a => Show (Refactoring a) |