commonmark-0.2.1: Pure Haskell commonmark parser.
Safe HaskellNone
LanguageHaskell2010

Commonmark.SourceMap

Synopsis

Documentation

newtype SourceMap Source #

A map from source positions to a pair of sequences: first, elements that start at that position; then, elements that end at that position.

Constructors

SourceMap 

Fields

Instances

Instances details
Show SourceMap Source # 
Instance details

Defined in Commonmark.SourceMap

Methods

showsPrec :: Int -> SourceMap -> ShowS

show :: SourceMap -> String

showList :: [SourceMap] -> ShowS

Semigroup SourceMap Source # 
Instance details

Defined in Commonmark.SourceMap

Methods

(<>) :: SourceMap -> SourceMap -> SourceMap

sconcat :: NonEmpty SourceMap -> SourceMap

stimes :: Integral b => b -> SourceMap -> SourceMap

Monoid SourceMap Source # 
Instance details

Defined in Commonmark.SourceMap

newtype WithSourceMap a Source #

Use this when you want to extract a source map as well as the parsed content.

Constructors

WithSourceMap 

Fields

Instances

Instances details
Monad WithSourceMap Source # 
Instance details

Defined in Commonmark.SourceMap

Functor WithSourceMap Source # 
Instance details

Defined in Commonmark.SourceMap

Methods

fmap :: (a -> b) -> WithSourceMap a -> WithSourceMap b

(<$) :: a -> WithSourceMap b -> WithSourceMap a

Applicative WithSourceMap Source # 
Instance details

Defined in Commonmark.SourceMap

(Show a, Monoid a) => Show (WithSourceMap a) Source # 
Instance details

Defined in Commonmark.SourceMap

Methods

showsPrec :: Int -> WithSourceMap a -> ShowS

show :: WithSourceMap a -> String

showList :: [WithSourceMap a] -> ShowS

(Show a, Semigroup a) => Semigroup (WithSourceMap a) Source # 
Instance details

Defined in Commonmark.SourceMap

Methods

(<>) :: WithSourceMap a -> WithSourceMap a -> WithSourceMap a

sconcat :: NonEmpty (WithSourceMap a) -> WithSourceMap a

stimes :: Integral b => b -> WithSourceMap a -> WithSourceMap a

(Show a, Semigroup a, Monoid a) => Monoid (WithSourceMap a) Source # 
Instance details

Defined in Commonmark.SourceMap

ToPlainText a => ToPlainText (WithSourceMap a) Source # 
Instance details

Defined in Commonmark.SourceMap

Methods

toPlainText :: WithSourceMap a -> Text Source #

HasAttributes (WithSourceMap a) Source # 
Instance details

Defined in Commonmark.SourceMap

(Rangeable a, Monoid a, Show a) => Rangeable (WithSourceMap a) Source # 
Instance details

Defined in Commonmark.SourceMap

(IsInline a, Semigroup a) => IsInline (WithSourceMap a) Source # 
Instance details

Defined in Commonmark.SourceMap

(IsBlock b a, IsInline b, IsInline (WithSourceMap b), Semigroup a) => IsBlock (WithSourceMap b) (WithSourceMap a) Source # 
Instance details

Defined in Commonmark.SourceMap

runWithSourceMap :: (Show a, Monoid a) => WithSourceMap a -> (a, SourceMap) Source #

Extract a parsed value and a source map from a WithSourceMap.