ormolu-0.1.2.0: A formatter for Haskell source code

Safe Haskell | None
Language | Haskell2010

Ormolu.Printer.SpanStream

Description

Build span stream from AST.

Synopsis

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

# Documentation

newtype SpanStream Source #

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

Eq SpanStream Source # |
Instance details Defined in Ormolu.Printer.SpanStream Methods (==) :: SpanStream -> SpanStream -> Bool Source # (/=) :: SpanStream -> SpanStream -> Bool Source #
Data SpanStream Source # |

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 Source #

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

toConstr :: SpanStream -> Constr Source #

dataTypeOf :: SpanStream -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Show SpanStream Source # |
Instance details Defined in Ormolu.Printer.SpanStream Methods showsPrec :: Int -> SpanStream -> ShowS Source # show :: SpanStream -> String Source # showList :: [SpanStream] -> ShowS Source #
Semigroup SpanStream Source # |
Instance details Defined in Ormolu.Printer.SpanStream Methods (<>) :: SpanStream -> SpanStream -> SpanStream Source # sconcat :: NonEmpty SpanStream -> SpanStream Source # stimes :: Integral b => b -> SpanStream -> SpanStream Source #
Monoid SpanStream Source # |
Instance details Defined in Ormolu.Printer.SpanStream Methods mempty :: SpanStream Source # mappend :: SpanStream -> SpanStream -> SpanStream Source # mconcat :: [SpanStream] -> SpanStream Source #

mkSpanStream Source #

Arguments

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

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