ormolu-0.7.4.0: A formatter for Haskell source code

Safe Haskell | None
Language | GHC2021

Ormolu.Printer.SpanStream

Description

Build span stream from AST.

Synopsis

- newtype SpanStream = SpanStream [RealSrcSpan]
- mkSpanStream :: Data a => a -> SpanStream

# Documentation

newtype SpanStream #

A stream of `RealSrcSpan`s in ascending order. This allows us to tell e.g. whether there is another "located" element of AST between current element and comment we're considering for printing.

Constructors

SpanStream [RealSrcSpan] |

#### Instances

Instances details

Data SpanStream # |
Instance details Defined in Ormolu.Printer.SpanStream Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SpanStream -> c SpanStream # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SpanStream # toConstr :: SpanStream -> Constr # dataTypeOf :: SpanStream -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SpanStream) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SpanStream) # gmapT :: (forall b. Data b => b -> b) -> SpanStream -> SpanStream # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SpanStream -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SpanStream -> r # gmapQ :: (forall d. Data d => d -> u) -> SpanStream -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SpanStream -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SpanStream -> m SpanStream # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SpanStream -> m SpanStream # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SpanStream -> m SpanStream #
Monoid SpanStream # |
Instance details Defined in Ormolu.Printer.SpanStream Methods mempty :: SpanStream # mappend :: SpanStream -> SpanStream -> SpanStream # mconcat :: [SpanStream] -> SpanStream #
Semigroup SpanStream # |
Instance details Defined in Ormolu.Printer.SpanStream Methods (<>) :: SpanStream -> SpanStream -> SpanStream # sconcat :: NonEmpty SpanStream -> SpanStream # stimes :: Integral b => b -> SpanStream -> SpanStream #
Show SpanStream # |
Instance details Defined in Ormolu.Printer.SpanStream Methods showsPrec :: Int -> SpanStream -> ShowS # show :: SpanStream -> String # showList :: [SpanStream] -> ShowS #
Eq SpanStream # |
Instance details Defined in Ormolu.Printer.SpanStream Methods (==) :: SpanStream -> SpanStream -> Bool # (/=) :: SpanStream -> SpanStream -> Bool #

mkSpanStream #

Arguments

:: Data a |
=> a | Data structure to inspect (AST)
-> SpanStream |

Create `SpanStream` from a data structure containing "located" elements.