ghc-exactprint-0.6.2: ExactPrint for GHC

Safe Haskell | None
Language | Haskell2010

Language.Haskell.GHC.ExactPrint.Types

Contents

- Core Types
- Positions
- AnnKey
- Other
- For managing compatibility
- GHC version compatibility
- Internal Types

Synopsis

- type Anns = Map AnnKey Annotation
- emptyAnns :: Anns
- data Annotation = Ann {
  - annEntryDelta :: !DeltaPos
  - annPriorComments :: ![(Comment, DeltaPos)]
  - annFollowingComments :: ![(Comment, DeltaPos)]
  - annsDP :: ![(KeywordId, DeltaPos)]
  - annSortKey :: !(Maybe [SrcSpan])
  - annCapturedSpan :: !(Maybe AnnKey)
  }
- annNone :: Annotation
- data KeywordId
  - = G AnnKeywordId
  - | AnnSemiSep
  - | AnnTypeApp
  - | AnnComment Comment
  - | AnnString String
- data Comment = Comment {
  - commentContents :: !String
  - commentIdentifier :: !SrcSpan
  - commentOrigin :: !(Maybe AnnKeywordId)
  }
- type Pos = (Int, Int)
- newtype DeltaPos = DP (Int, Int)
- deltaRow :: DeltaPos -> Int
- deltaColumn :: DeltaPos -> Int
- data AnnKey = AnnKey SrcSpan AnnConName
- mkAnnKey :: Constraints a => a -> AnnKey
- data AnnConName = CN {
  - unConName :: String
  }
- annGetConstr :: Data a => a -> AnnConName
- data Rigidity
  - = NormalLayout
  - | RigidLayout
- data AstContext
  - = LambdaExpr
  - | CaseAlt
  - | NoPrecedingSpace
  - | HasHiding
  - | AdvanceLine
  - | NoAdvanceLine
  - | Intercalate
  - | InIE
  - | PrefixOp
  - | PrefixOpDollar
  - | InfixOp
  - | ListStart
  - | ListItem
  - | TopLevel
  - | NoDarrow
  - | AddVbar
  - | Deriving
  - | Parens
  - | ExplicitNeverActive
  - | InGadt
  - | InRecCon
  - | InClassDecl
  - | InSpliceDecl
  - | LeftMost
  - | InTypeApp
  - | CtxOnly
  - | CtxFirst
  - | CtxMiddle
  - | CtxLast
  - | CtxPos Int
  - | FollowingLine
- type AstContextSet = ACS' AstContext
- defaultACS :: AstContextSet
- data ACS' a = ACS {
  - acs :: !(Map a Int)
  }
- data ListContexts = LC {
  - lcOnly, lcInitial, lcMiddle, lcLast :: !(Set AstContext)
  }
- type Constraints a = (Data a, Data (SrcSpanLess a), HasSrcSpan a)
- type GhcPs = GhcPs
- type GhcRn = GhcRn
- type GhcTc = GhcTc
- newtype LayoutStartCol = LayoutStartCol {
  - getLayoutStartCol :: Int
  }
- declFun :: (forall a. Data a => Located a -> b) -> LHsDecl GhcPs -> b

# Core Types

type Anns = Map AnnKey Annotation Source #

This structure holds a complete set of annotations for an AST

emptyAnns :: Anns Source #

data Annotation Source #

Constructors

Ann |

Fields

- annEntryDelta :: !DeltaPos

  Offset used to get to the start of the SrcSpan, from whatever the prior output was, including all annPriorComments (field below).

- annPriorComments :: ![(Comment, DeltaPos)]

  Comments coming after the last non-comment output of the preceding element but before the SrcSpan being annotated by this Annotation. If these are changed then annEntryDelta (field above) must also change to match.

- annFollowingComments :: ![(Comment, DeltaPos)]

  Comments coming after the last output for the element subject to this Annotation. These will only be added by AST transformations, and care must be taken not to disturb layout of following elements.

- annsDP :: ![(KeywordId, DeltaPos)]

  Annotations associated with this element.

- annSortKey :: !(Maybe [SrcSpan])

  Captures the sort order of sub elements. This is needed when the sub-elements have been split (as in a HsLocalBind which holds separate binds and sigs) or for infix patterns where the order has been re-arranged. It is captured explicitly so that after the Delta phase a SrcSpan is used purely as an index into the annotations, allowing transformations of the AST including the introduction of new Located items or re-arranging existing ones.

- annCapturedSpan :: !(Maybe AnnKey)

  Occasionally we must calculate a SrcSpan for an unlocated list of elements which we must remember for the Print phase. e.g. the statements in a HsLet or HsDo. These must be managed as a group because they all need eo be vertically aligned for the Haskell layout rules, and this guarantees this property in the presence of AST edits.

#### Instances

Instances details

Eq Annotation Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (==) :: Annotation -> Annotation -> Bool Source # (/=) :: Annotation -> Annotation -> Bool Source #
Show Annotation Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> Annotation -> ShowS Source # show :: Annotation -> String Source # showList :: [Annotation] -> ShowS Source #
Outputable Annotation Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods ppr :: Annotation -> SDoc Source # pprPrec :: Rational -> Annotation -> SDoc Source #
Monad m => MonadState (Anns, Int) (TransformT m) Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Transform Methods get :: TransformT m (Anns, Int) Source # put :: (Anns, Int) -> TransformT m () Source # state :: ((Anns, Int) -> (a, (Anns, Int))) -> TransformT m a Source #

annNone :: Annotation Source #

data KeywordId Source #

The different syntactic elements which are not represented in the AST.

Constructors

G AnnKeywordId | A normal keyword
AnnSemiSep | A separating comma
AnnTypeApp | Visible type application annotation
AnnComment Comment |
AnnString String | Used to pass information from Delta to Print when we have to work out details from the original SrcSpan.

#### Instances

Instances details

Eq KeywordId Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (==) :: KeywordId -> KeywordId -> Bool Source # (/=) :: KeywordId -> KeywordId -> Bool Source #
Data KeywordId Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

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

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

toConstr :: KeywordId -> Constr Source #

dataTypeOf :: KeywordId -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord KeywordId Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

compare :: KeywordId -> KeywordId -> Ordering Source #

(<) :: KeywordId -> KeywordId -> Bool Source #

(<=) :: KeywordId -> KeywordId -> Bool Source #

(>) :: KeywordId -> KeywordId -> Bool Source #

(>=) :: KeywordId -> KeywordId -> Bool Source #

max :: KeywordId -> KeywordId -> KeywordId Source #

min :: KeywordId -> KeywordId -> KeywordId Source #

Show KeywordId Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> KeywordId -> ShowS Source # show :: KeywordId -> String Source # showList :: [KeywordId] -> ShowS Source #
Outputable KeywordId Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods ppr :: KeywordId -> SDoc Source # pprPrec :: Rational -> KeywordId -> SDoc Source #

data Comment Source #

A Haskell comment. The `AnnKeywordId` is present if it has been converted from an `AnnKeywordId` because the annotation must be interleaved into the stream and does not have a well-defined position

Constructors

Comment |

Fields

- commentContents :: !String

  The contents of the comment including separators

- commentIdentifier :: !SrcSpan

  Needed to uniquely identify two comments with the same contents

- commentOrigin :: !(Maybe AnnKeywordId)

  We sometimes turn syntax into comments in order to process them properly.

#### Instances

Instances details

Eq Comment Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (==) :: Comment -> Comment -> Bool Source # (/=) :: Comment -> Comment -> Bool Source #
Data Comment Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

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

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

toConstr :: Comment -> Constr Source #

dataTypeOf :: Comment -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord Comment Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods compare :: Comment -> Comment -> Ordering Source # (<) :: Comment -> Comment -> Bool Source # (<=) :: Comment -> Comment -> Bool Source # (>) :: Comment -> Comment -> Bool Source # (>=) :: Comment -> Comment -> Bool Source # max :: Comment -> Comment -> Comment Source # min :: Comment -> Comment -> Comment Source #
Show Comment Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> Comment -> ShowS Source # show :: Comment -> String Source # showList :: [Comment] -> ShowS Source #
Outputable Comment Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods ppr :: Comment -> SDoc Source # pprPrec :: Rational -> Comment -> SDoc Source #

# Positions

type Pos = (Int, Int) Source #

newtype DeltaPos Source #

A relative positions, row then column

Constructors

DP (Int, Int) |

#### Instances

Instances details

Eq DeltaPos Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (==) :: DeltaPos -> DeltaPos -> Bool Source # (/=) :: DeltaPos -> DeltaPos -> Bool Source #
Data DeltaPos Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

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

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

toConstr :: DeltaPos -> Constr Source #

dataTypeOf :: DeltaPos -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord DeltaPos Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

compare :: DeltaPos -> DeltaPos -> Ordering Source #

(<) :: DeltaPos -> DeltaPos -> Bool Source #

(<=) :: DeltaPos -> DeltaPos -> Bool Source #

(>) :: DeltaPos -> DeltaPos -> Bool Source #

(>=) :: DeltaPos -> DeltaPos -> Bool Source #

max :: DeltaPos -> DeltaPos -> DeltaPos Source #

min :: DeltaPos -> DeltaPos -> DeltaPos Source #

Show DeltaPos Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> DeltaPos -> ShowS Source # show :: DeltaPos -> String Source # showList :: [DeltaPos] -> ShowS Source #
Outputable DeltaPos Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods ppr :: DeltaPos -> SDoc Source # pprPrec :: Rational -> DeltaPos -> SDoc Source #

deltaRow :: DeltaPos -> Int Source #

deltaColumn :: DeltaPos -> Int Source #

# AnnKey

data AnnKey Source #

For every `Located a`, use the `SrcSpan` and constructor name of a as the key, to store the standard annotation. These are used to maintain context in the AP and EP monads

Constructors

AnnKey SrcSpan AnnConName |

#### Instances

Instances details

Eq AnnKey Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (==) :: AnnKey -> AnnKey -> Bool Source # (/=) :: AnnKey -> AnnKey -> Bool Source #
Data AnnKey Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

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

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

toConstr :: AnnKey -> Constr Source #

dataTypeOf :: AnnKey -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord AnnKey Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods compare :: AnnKey -> AnnKey -> Ordering Source # (<) :: AnnKey -> AnnKey -> Bool Source # (<=) :: AnnKey -> AnnKey -> Bool Source # (>) :: AnnKey -> AnnKey -> Bool Source # (>=) :: AnnKey -> AnnKey -> Bool Source # max :: AnnKey -> AnnKey -> AnnKey Source # min :: AnnKey -> AnnKey -> AnnKey Source #
Show AnnKey Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> AnnKey -> ShowS Source # show :: AnnKey -> String Source # showList :: [AnnKey] -> ShowS Source #
Outputable AnnKey Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods ppr :: AnnKey -> SDoc Source # pprPrec :: Rational -> AnnKey -> SDoc Source #
Monad m => MonadState (Anns, Int) (TransformT m) Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Transform Methods get :: TransformT m (Anns, Int) Source # put :: (Anns, Int) -> TransformT m () Source # state :: ((Anns, Int) -> (a, (Anns, Int))) -> TransformT m a Source #

mkAnnKey :: Constraints a => a -> AnnKey Source #

Make an unwrapped `AnnKey` for the `LHsDecl` case, a normal one otherwise.

data AnnConName Source #

Constructors

CN |

Fields

- unConName :: String

#### Instances

Instances details

Eq AnnConName Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (==) :: AnnConName -> AnnConName -> Bool Source # (/=) :: AnnConName -> AnnConName -> Bool Source #
Data AnnConName Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

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

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

toConstr :: AnnConName -> Constr Source #

dataTypeOf :: AnnConName -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord AnnConName Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

compare :: AnnConName -> AnnConName -> Ordering Source #

(<) :: AnnConName -> AnnConName -> Bool Source #

(<=) :: AnnConName -> AnnConName -> Bool Source #

(>) :: AnnConName -> AnnConName -> Bool Source #

(>=) :: AnnConName -> AnnConName -> Bool Source #

max :: AnnConName -> AnnConName -> AnnConName Source #

min :: AnnConName -> AnnConName -> AnnConName Source #

Show AnnConName Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> AnnConName -> ShowS Source # show :: AnnConName -> String Source # showList :: [AnnConName] -> ShowS Source #
Outputable AnnConName Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods ppr :: AnnConName -> SDoc Source # pprPrec :: Rational -> AnnConName -> SDoc Source #

annGetConstr :: Data a => a -> AnnConName Source #

# Other

data Rigidity Source #

Constructors

NormalLayout |
RigidLayout |

#### Instances

Instances details

Eq Rigidity Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (==) :: Rigidity -> Rigidity -> Bool Source # (/=) :: Rigidity -> Rigidity -> Bool Source #
Ord Rigidity Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

compare :: Rigidity -> Rigidity -> Ordering Source #

(<) :: Rigidity -> Rigidity -> Bool Source #

(<=) :: Rigidity -> Rigidity -> Bool Source #

(>) :: Rigidity -> Rigidity -> Bool Source #

(>=) :: Rigidity -> Rigidity -> Bool Source #

max :: Rigidity -> Rigidity -> Rigidity Source #

min :: Rigidity -> Rigidity -> Rigidity Source #

Show Rigidity Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> Rigidity -> ShowS Source # show :: Rigidity -> String Source # showList :: [Rigidity] -> ShowS Source #

data AstContext Source #

Constructors

LambdaExpr |
CaseAlt |
NoPrecedingSpace |
HasHiding |
AdvanceLine |
NoAdvanceLine |
Intercalate |
InIE |
PrefixOp |
PrefixOpDollar |
InfixOp |
ListStart |
ListItem |
TopLevel |
NoDarrow |
AddVbar |
Deriving |
Parens |
ExplicitNeverActive |
InGadt |
InRecCon |
InClassDecl |
InSpliceDecl |
LeftMost |
InTypeApp |
CtxOnly |
CtxFirst |
CtxMiddle |
CtxLast |
CtxPos Int |
FollowingLine |

#### Instances

Instances details

Eq AstContext Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (==) :: AstContext -> AstContext -> Bool Source # (/=) :: AstContext -> AstContext -> Bool Source #
Ord AstContext Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

compare :: AstContext -> AstContext -> Ordering Source #

(<) :: AstContext -> AstContext -> Bool Source #

(<=) :: AstContext -> AstContext -> Bool Source #

(>) :: AstContext -> AstContext -> Bool Source #

(>=) :: AstContext -> AstContext -> Bool Source #

max :: AstContext -> AstContext -> AstContext Source #

min :: AstContext -> AstContext -> AstContext Source #

Show AstContext Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> AstContext -> ShowS Source # show :: AstContext -> String Source # showList :: [AstContext] -> ShowS Source #
Semigroup (ACS' AstContext) Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (<>) :: ACS' AstContext -> ACS' AstContext -> ACS' AstContext Source # sconcat :: NonEmpty (ACS' AstContext) -> ACS' AstContext Source # stimes :: Integral b => b -> ACS' AstContext -> ACS' AstContext Source #
Monoid (ACS' AstContext) Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods mempty :: ACS' AstContext Source # mappend :: ACS' AstContext -> ACS' AstContext -> ACS' AstContext Source # mconcat :: [ACS' AstContext] -> ACS' AstContext Source #

type AstContextSet = ACS' AstContext Source #

defaultACS :: AstContextSet Source #

data ACS' a Source #

Constructors

ACS |

Fields

- acs :: !(Map a Int)

  how many levels each AstContext should propagate down the AST. Removed when it hits zero

#### Instances

Instances details

Show a => Show (ACS' a) Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> ACS' a -> ShowS Source # show :: ACS' a -> String Source # showList :: [ACS' a] -> ShowS Source #
Semigroup (ACS' AstContext) Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (<>) :: ACS' AstContext -> ACS' AstContext -> ACS' AstContext Source # sconcat :: NonEmpty (ACS' AstContext) -> ACS' AstContext Source # stimes :: Integral b => b -> ACS' AstContext -> ACS' AstContext Source #
Monoid (ACS' AstContext) Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods mempty :: ACS' AstContext Source # mappend :: ACS' AstContext -> ACS' AstContext -> ACS' AstContext Source # mconcat :: [ACS' AstContext] -> ACS' AstContext Source #
Show a => Outputable (ACS' a) Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods ppr :: ACS' a -> SDoc Source # pprPrec :: Rational -> ACS' a -> SDoc Source #

data ListContexts Source #

Constructors

LC |

Fields

- lcOnly, lcInitial, lcMiddle, lcLast :: !(Set AstContext)

#### Instances

Instances details

Eq ListContexts Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (==) :: ListContexts -> ListContexts -> Bool Source # (/=) :: ListContexts -> ListContexts -> Bool Source #
Show ListContexts Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> ListContexts -> ShowS Source # show :: ListContexts -> String Source # showList :: [ListContexts] -> ShowS Source #

# For managing compatibility

type Constraints a = (Data a, Data (SrcSpanLess a), HasSrcSpan a) Source #

# GHC version compatibility

type GhcPs = GhcPs Source #

type GhcRn = GhcRn Source #

type GhcTc = GhcTc Source #

# Internal Types

newtype LayoutStartCol Source #

Marks the start column of a layout block.

Constructors

LayoutStartCol |

Fields

- getLayoutStartCol :: Int

#### Instances

Instances details

Eq LayoutStartCol Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods (==) :: LayoutStartCol -> LayoutStartCol -> Bool Source # (/=) :: LayoutStartCol -> LayoutStartCol -> Bool Source #
Num LayoutStartCol Source # |

Instance details

Defined in Language.Haskell.GHC.ExactPrint.Types

Methods

(+) :: LayoutStartCol -> LayoutStartCol -> LayoutStartCol Source #

(-) :: LayoutStartCol -> LayoutStartCol -> LayoutStartCol Source #

(*) :: LayoutStartCol -> LayoutStartCol -> LayoutStartCol Source #

negate :: LayoutStartCol -> LayoutStartCol Source #

abs :: LayoutStartCol -> LayoutStartCol Source #

signum :: LayoutStartCol -> LayoutStartCol Source #

fromInteger :: Integer -> LayoutStartCol Source #

Show LayoutStartCol Source # |
Instance details Defined in Language.Haskell.GHC.ExactPrint.Types Methods showsPrec :: Int -> LayoutStartCol -> ShowS Source # show :: LayoutStartCol -> String Source # showList :: [LayoutStartCol] -> ShowS Source #

declFun :: (forall a. Data a => Located a -> b) -> LHsDecl GhcPs -> b Source #