{-# LANGUAGE DeriveDataTypeable         #-}
{-# LANGUAGE FunctionalDependencies     #-}
{-# LANGUAGE OverloadedStrings          #-}
{-# LANGUAGE MonoLocalBinds             #-}

module Commonmark.Types
  ( Format(..)
  , ListSpacing(..)
  , ListType(..)
  , DelimiterType(..)
  , EnumeratorType(..)
  , IsInline(..)
  , IsBlock(..)
  , SourceRange(..)
  , SourcePos
  , Rangeable(..)
  , Attribute
  , Attributes
  , HasAttributes(..)
  , ToPlainText(..)
  )
where
import           Data.Data            (Data)
import           Data.Text            (Text)
import qualified Data.Text            as T
import           Data.Typeable        (Typeable)
import           Text.Parsec.Pos      (SourcePos, sourceColumn, sourceLine,
                                       sourceName)

newtype Format = Format Text
  deriving (Int -> Format -> ShowS
[Format] -> ShowS
Format -> String
(Int -> Format -> ShowS)
-> (Format -> String) -> ([Format] -> ShowS) -> Show Format
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Format] -> ShowS
$cshowList :: [Format] -> ShowS
show :: Format -> String
$cshow :: Format -> String
showsPrec :: Int -> Format -> ShowS
$cshowsPrec :: Int -> Format -> ShowS
Show, Typeable Format
DataType
Constr
Typeable Format
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Format -> c Format)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Format)
-> (Format -> Constr)
-> (Format -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Format))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Format))
-> ((forall b. Data b => b -> b) -> Format -> Format)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Format -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Format -> r)
-> (forall u. (forall d. Data d => d -> u) -> Format -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Format -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Format -> m Format)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Format -> m Format)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Format -> m Format)
-> Data Format
Format -> DataType
Format -> Constr
(forall b. Data b => b -> b) -> Format -> Format
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Format -> c Format
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Format
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Format -> u
forall u. (forall d. Data d => d -> u) -> Format -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Format -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Format -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Format -> m Format
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Format -> m Format
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Format
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Format -> c Format
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Format)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Format)
$cFormat :: Constr
$tFormat :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Format -> m Format
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Format -> m Format
gmapMp :: (forall d. Data d => d -> m d) -> Format -> m Format
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Format -> m Format
gmapM :: (forall d. Data d => d -> m d) -> Format -> m Format
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Format -> m Format
gmapQi :: Int -> (forall d. Data d => d -> u) -> Format -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Format -> u
gmapQ :: (forall d. Data d => d -> u) -> Format -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Format -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Format -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Format -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Format -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Format -> r
gmapT :: (forall b. Data b => b -> b) -> Format -> Format
$cgmapT :: (forall b. Data b => b -> b) -> Format -> Format
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Format)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Format)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Format)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Format)
dataTypeOf :: Format -> DataType
$cdataTypeOf :: Format -> DataType
toConstr :: Format -> Constr
$ctoConstr :: Format -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Format
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Format
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Format -> c Format
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Format -> c Format
$cp1Data :: Typeable Format
Data, Typeable)

instance Eq Format where
  (Format Text
t1) == :: Format -> Format -> Bool
== (Format Text
t2) = Text -> Text
T.toCaseFold Text
t1 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text -> Text
T.toCaseFold Text
t2

data ListSpacing =
       TightList
     | LooseList
     deriving (Int -> ListSpacing -> ShowS
[ListSpacing] -> ShowS
ListSpacing -> String
(Int -> ListSpacing -> ShowS)
-> (ListSpacing -> String)
-> ([ListSpacing] -> ShowS)
-> Show ListSpacing
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSpacing] -> ShowS
$cshowList :: [ListSpacing] -> ShowS
show :: ListSpacing -> String
$cshow :: ListSpacing -> String
showsPrec :: Int -> ListSpacing -> ShowS
$cshowsPrec :: Int -> ListSpacing -> ShowS
Show, Eq ListSpacing
Eq ListSpacing
-> (ListSpacing -> ListSpacing -> Ordering)
-> (ListSpacing -> ListSpacing -> Bool)
-> (ListSpacing -> ListSpacing -> Bool)
-> (ListSpacing -> ListSpacing -> Bool)
-> (ListSpacing -> ListSpacing -> Bool)
-> (ListSpacing -> ListSpacing -> ListSpacing)
-> (ListSpacing -> ListSpacing -> ListSpacing)
-> Ord ListSpacing
ListSpacing -> ListSpacing -> Bool
ListSpacing -> ListSpacing -> Ordering
ListSpacing -> ListSpacing -> ListSpacing
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ListSpacing -> ListSpacing -> ListSpacing
$cmin :: ListSpacing -> ListSpacing -> ListSpacing
max :: ListSpacing -> ListSpacing -> ListSpacing
$cmax :: ListSpacing -> ListSpacing -> ListSpacing
>= :: ListSpacing -> ListSpacing -> Bool
$c>= :: ListSpacing -> ListSpacing -> Bool
> :: ListSpacing -> ListSpacing -> Bool
$c> :: ListSpacing -> ListSpacing -> Bool
<= :: ListSpacing -> ListSpacing -> Bool
$c<= :: ListSpacing -> ListSpacing -> Bool
< :: ListSpacing -> ListSpacing -> Bool
$c< :: ListSpacing -> ListSpacing -> Bool
compare :: ListSpacing -> ListSpacing -> Ordering
$ccompare :: ListSpacing -> ListSpacing -> Ordering
$cp1Ord :: Eq ListSpacing
Ord, ListSpacing -> ListSpacing -> Bool
(ListSpacing -> ListSpacing -> Bool)
-> (ListSpacing -> ListSpacing -> Bool) -> Eq ListSpacing
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSpacing -> ListSpacing -> Bool
$c/= :: ListSpacing -> ListSpacing -> Bool
== :: ListSpacing -> ListSpacing -> Bool
$c== :: ListSpacing -> ListSpacing -> Bool
Eq, Typeable ListSpacing
DataType
Constr
Typeable ListSpacing
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ListSpacing -> c ListSpacing)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ListSpacing)
-> (ListSpacing -> Constr)
-> (ListSpacing -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ListSpacing))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ListSpacing))
-> ((forall b. Data b => b -> b) -> ListSpacing -> ListSpacing)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ListSpacing -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ListSpacing -> r)
-> (forall u. (forall d. Data d => d -> u) -> ListSpacing -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ListSpacing -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing)
-> Data ListSpacing
ListSpacing -> DataType
ListSpacing -> Constr
(forall b. Data b => b -> b) -> ListSpacing -> ListSpacing
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListSpacing -> c ListSpacing
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ListSpacing
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ListSpacing -> u
forall u. (forall d. Data d => d -> u) -> ListSpacing -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListSpacing -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListSpacing -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ListSpacing
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListSpacing -> c ListSpacing
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ListSpacing)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ListSpacing)
$cLooseList :: Constr
$cTightList :: Constr
$tListSpacing :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing
gmapMp :: (forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing
gmapM :: (forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ListSpacing -> m ListSpacing
gmapQi :: Int -> (forall d. Data d => d -> u) -> ListSpacing -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ListSpacing -> u
gmapQ :: (forall d. Data d => d -> u) -> ListSpacing -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ListSpacing -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListSpacing -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListSpacing -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListSpacing -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListSpacing -> r
gmapT :: (forall b. Data b => b -> b) -> ListSpacing -> ListSpacing
$cgmapT :: (forall b. Data b => b -> b) -> ListSpacing -> ListSpacing
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ListSpacing)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ListSpacing)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ListSpacing)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ListSpacing)
dataTypeOf :: ListSpacing -> DataType
$cdataTypeOf :: ListSpacing -> DataType
toConstr :: ListSpacing -> Constr
$ctoConstr :: ListSpacing -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ListSpacing
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ListSpacing
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListSpacing -> c ListSpacing
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListSpacing -> c ListSpacing
$cp1Data :: Typeable ListSpacing
Data, Typeable)

data EnumeratorType =
       Decimal
     | UpperAlpha
     | LowerAlpha
     | UpperRoman
     | LowerRoman
     deriving (Int -> EnumeratorType -> ShowS
[EnumeratorType] -> ShowS
EnumeratorType -> String
(Int -> EnumeratorType -> ShowS)
-> (EnumeratorType -> String)
-> ([EnumeratorType] -> ShowS)
-> Show EnumeratorType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnumeratorType] -> ShowS
$cshowList :: [EnumeratorType] -> ShowS
show :: EnumeratorType -> String
$cshow :: EnumeratorType -> String
showsPrec :: Int -> EnumeratorType -> ShowS
$cshowsPrec :: Int -> EnumeratorType -> ShowS
Show, Eq EnumeratorType
Eq EnumeratorType
-> (EnumeratorType -> EnumeratorType -> Ordering)
-> (EnumeratorType -> EnumeratorType -> Bool)
-> (EnumeratorType -> EnumeratorType -> Bool)
-> (EnumeratorType -> EnumeratorType -> Bool)
-> (EnumeratorType -> EnumeratorType -> Bool)
-> (EnumeratorType -> EnumeratorType -> EnumeratorType)
-> (EnumeratorType -> EnumeratorType -> EnumeratorType)
-> Ord EnumeratorType
EnumeratorType -> EnumeratorType -> Bool
EnumeratorType -> EnumeratorType -> Ordering
EnumeratorType -> EnumeratorType -> EnumeratorType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: EnumeratorType -> EnumeratorType -> EnumeratorType
$cmin :: EnumeratorType -> EnumeratorType -> EnumeratorType
max :: EnumeratorType -> EnumeratorType -> EnumeratorType
$cmax :: EnumeratorType -> EnumeratorType -> EnumeratorType
>= :: EnumeratorType -> EnumeratorType -> Bool
$c>= :: EnumeratorType -> EnumeratorType -> Bool
> :: EnumeratorType -> EnumeratorType -> Bool
$c> :: EnumeratorType -> EnumeratorType -> Bool
<= :: EnumeratorType -> EnumeratorType -> Bool
$c<= :: EnumeratorType -> EnumeratorType -> Bool
< :: EnumeratorType -> EnumeratorType -> Bool
$c< :: EnumeratorType -> EnumeratorType -> Bool
compare :: EnumeratorType -> EnumeratorType -> Ordering
$ccompare :: EnumeratorType -> EnumeratorType -> Ordering
$cp1Ord :: Eq EnumeratorType
Ord, EnumeratorType -> EnumeratorType -> Bool
(EnumeratorType -> EnumeratorType -> Bool)
-> (EnumeratorType -> EnumeratorType -> Bool) -> Eq EnumeratorType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnumeratorType -> EnumeratorType -> Bool
$c/= :: EnumeratorType -> EnumeratorType -> Bool
== :: EnumeratorType -> EnumeratorType -> Bool
$c== :: EnumeratorType -> EnumeratorType -> Bool
Eq, Typeable EnumeratorType
DataType
Constr
Typeable EnumeratorType
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> EnumeratorType -> c EnumeratorType)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c EnumeratorType)
-> (EnumeratorType -> Constr)
-> (EnumeratorType -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c EnumeratorType))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c EnumeratorType))
-> ((forall b. Data b => b -> b)
    -> EnumeratorType -> EnumeratorType)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> EnumeratorType -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> EnumeratorType -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> EnumeratorType -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> EnumeratorType -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> EnumeratorType -> m EnumeratorType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> EnumeratorType -> m EnumeratorType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> EnumeratorType -> m EnumeratorType)
-> Data EnumeratorType
EnumeratorType -> DataType
EnumeratorType -> Constr
(forall b. Data b => b -> b) -> EnumeratorType -> EnumeratorType
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> EnumeratorType -> c EnumeratorType
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c EnumeratorType
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> EnumeratorType -> u
forall u. (forall d. Data d => d -> u) -> EnumeratorType -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> EnumeratorType -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> EnumeratorType -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> EnumeratorType -> m EnumeratorType
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> EnumeratorType -> m EnumeratorType
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c EnumeratorType
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> EnumeratorType -> c EnumeratorType
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c EnumeratorType)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c EnumeratorType)
$cLowerRoman :: Constr
$cUpperRoman :: Constr
$cLowerAlpha :: Constr
$cUpperAlpha :: Constr
$cDecimal :: Constr
$tEnumeratorType :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> EnumeratorType -> m EnumeratorType
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> EnumeratorType -> m EnumeratorType
gmapMp :: (forall d. Data d => d -> m d)
-> EnumeratorType -> m EnumeratorType
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> EnumeratorType -> m EnumeratorType
gmapM :: (forall d. Data d => d -> m d)
-> EnumeratorType -> m EnumeratorType
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> EnumeratorType -> m EnumeratorType
gmapQi :: Int -> (forall d. Data d => d -> u) -> EnumeratorType -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> EnumeratorType -> u
gmapQ :: (forall d. Data d => d -> u) -> EnumeratorType -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> EnumeratorType -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> EnumeratorType -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> EnumeratorType -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> EnumeratorType -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> EnumeratorType -> r
gmapT :: (forall b. Data b => b -> b) -> EnumeratorType -> EnumeratorType
$cgmapT :: (forall b. Data b => b -> b) -> EnumeratorType -> EnumeratorType
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c EnumeratorType)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c EnumeratorType)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c EnumeratorType)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c EnumeratorType)
dataTypeOf :: EnumeratorType -> DataType
$cdataTypeOf :: EnumeratorType -> DataType
toConstr :: EnumeratorType -> Constr
$ctoConstr :: EnumeratorType -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c EnumeratorType
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c EnumeratorType
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> EnumeratorType -> c EnumeratorType
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> EnumeratorType -> c EnumeratorType
$cp1Data :: Typeable EnumeratorType
Data, Typeable)

data DelimiterType =
       Period
     | OneParen
     | TwoParens
     deriving (Int -> DelimiterType -> ShowS
[DelimiterType] -> ShowS
DelimiterType -> String
(Int -> DelimiterType -> ShowS)
-> (DelimiterType -> String)
-> ([DelimiterType] -> ShowS)
-> Show DelimiterType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DelimiterType] -> ShowS
$cshowList :: [DelimiterType] -> ShowS
show :: DelimiterType -> String
$cshow :: DelimiterType -> String
showsPrec :: Int -> DelimiterType -> ShowS
$cshowsPrec :: Int -> DelimiterType -> ShowS
Show, Eq DelimiterType
Eq DelimiterType
-> (DelimiterType -> DelimiterType -> Ordering)
-> (DelimiterType -> DelimiterType -> Bool)
-> (DelimiterType -> DelimiterType -> Bool)
-> (DelimiterType -> DelimiterType -> Bool)
-> (DelimiterType -> DelimiterType -> Bool)
-> (DelimiterType -> DelimiterType -> DelimiterType)
-> (DelimiterType -> DelimiterType -> DelimiterType)
-> Ord DelimiterType
DelimiterType -> DelimiterType -> Bool
DelimiterType -> DelimiterType -> Ordering
DelimiterType -> DelimiterType -> DelimiterType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: DelimiterType -> DelimiterType -> DelimiterType
$cmin :: DelimiterType -> DelimiterType -> DelimiterType
max :: DelimiterType -> DelimiterType -> DelimiterType
$cmax :: DelimiterType -> DelimiterType -> DelimiterType
>= :: DelimiterType -> DelimiterType -> Bool
$c>= :: DelimiterType -> DelimiterType -> Bool
> :: DelimiterType -> DelimiterType -> Bool
$c> :: DelimiterType -> DelimiterType -> Bool
<= :: DelimiterType -> DelimiterType -> Bool
$c<= :: DelimiterType -> DelimiterType -> Bool
< :: DelimiterType -> DelimiterType -> Bool
$c< :: DelimiterType -> DelimiterType -> Bool
compare :: DelimiterType -> DelimiterType -> Ordering
$ccompare :: DelimiterType -> DelimiterType -> Ordering
$cp1Ord :: Eq DelimiterType
Ord, DelimiterType -> DelimiterType -> Bool
(DelimiterType -> DelimiterType -> Bool)
-> (DelimiterType -> DelimiterType -> Bool) -> Eq DelimiterType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DelimiterType -> DelimiterType -> Bool
$c/= :: DelimiterType -> DelimiterType -> Bool
== :: DelimiterType -> DelimiterType -> Bool
$c== :: DelimiterType -> DelimiterType -> Bool
Eq, Typeable DelimiterType
DataType
Constr
Typeable DelimiterType
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> DelimiterType -> c DelimiterType)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c DelimiterType)
-> (DelimiterType -> Constr)
-> (DelimiterType -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c DelimiterType))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c DelimiterType))
-> ((forall b. Data b => b -> b) -> DelimiterType -> DelimiterType)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DelimiterType -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DelimiterType -> r)
-> (forall u. (forall d. Data d => d -> u) -> DelimiterType -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> DelimiterType -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType)
-> Data DelimiterType
DelimiterType -> DataType
DelimiterType -> Constr
(forall b. Data b => b -> b) -> DelimiterType -> DelimiterType
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DelimiterType -> c DelimiterType
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DelimiterType
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> DelimiterType -> u
forall u. (forall d. Data d => d -> u) -> DelimiterType -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DelimiterType -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DelimiterType -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DelimiterType
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DelimiterType -> c DelimiterType
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DelimiterType)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DelimiterType)
$cTwoParens :: Constr
$cOneParen :: Constr
$cPeriod :: Constr
$tDelimiterType :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType
gmapMp :: (forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType
gmapM :: (forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DelimiterType -> m DelimiterType
gmapQi :: Int -> (forall d. Data d => d -> u) -> DelimiterType -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DelimiterType -> u
gmapQ :: (forall d. Data d => d -> u) -> DelimiterType -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DelimiterType -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DelimiterType -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DelimiterType -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DelimiterType -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DelimiterType -> r
gmapT :: (forall b. Data b => b -> b) -> DelimiterType -> DelimiterType
$cgmapT :: (forall b. Data b => b -> b) -> DelimiterType -> DelimiterType
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DelimiterType)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DelimiterType)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c DelimiterType)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DelimiterType)
dataTypeOf :: DelimiterType -> DataType
$cdataTypeOf :: DelimiterType -> DataType
toConstr :: DelimiterType -> Constr
$ctoConstr :: DelimiterType -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DelimiterType
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DelimiterType
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DelimiterType -> c DelimiterType
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DelimiterType -> c DelimiterType
$cp1Data :: Typeable DelimiterType
Data, Typeable)

data ListType =
       BulletList !Char
     | OrderedList !Int !EnumeratorType !DelimiterType
     -- first Text is before, second Text is after enumerator
     deriving (Int -> ListType -> ShowS
[ListType] -> ShowS
ListType -> String
(Int -> ListType -> ShowS)
-> (ListType -> String) -> ([ListType] -> ShowS) -> Show ListType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListType] -> ShowS
$cshowList :: [ListType] -> ShowS
show :: ListType -> String
$cshow :: ListType -> String
showsPrec :: Int -> ListType -> ShowS
$cshowsPrec :: Int -> ListType -> ShowS
Show, Eq ListType
Eq ListType
-> (ListType -> ListType -> Ordering)
-> (ListType -> ListType -> Bool)
-> (ListType -> ListType -> Bool)
-> (ListType -> ListType -> Bool)
-> (ListType -> ListType -> Bool)
-> (ListType -> ListType -> ListType)
-> (ListType -> ListType -> ListType)
-> Ord ListType
ListType -> ListType -> Bool
ListType -> ListType -> Ordering
ListType -> ListType -> ListType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ListType -> ListType -> ListType
$cmin :: ListType -> ListType -> ListType
max :: ListType -> ListType -> ListType
$cmax :: ListType -> ListType -> ListType
>= :: ListType -> ListType -> Bool
$c>= :: ListType -> ListType -> Bool
> :: ListType -> ListType -> Bool
$c> :: ListType -> ListType -> Bool
<= :: ListType -> ListType -> Bool
$c<= :: ListType -> ListType -> Bool
< :: ListType -> ListType -> Bool
$c< :: ListType -> ListType -> Bool
compare :: ListType -> ListType -> Ordering
$ccompare :: ListType -> ListType -> Ordering
$cp1Ord :: Eq ListType
Ord, ListType -> ListType -> Bool
(ListType -> ListType -> Bool)
-> (ListType -> ListType -> Bool) -> Eq ListType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListType -> ListType -> Bool
$c/= :: ListType -> ListType -> Bool
== :: ListType -> ListType -> Bool
$c== :: ListType -> ListType -> Bool
Eq, Typeable ListType
DataType
Constr
Typeable ListType
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ListType -> c ListType)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ListType)
-> (ListType -> Constr)
-> (ListType -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ListType))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ListType))
-> ((forall b. Data b => b -> b) -> ListType -> ListType)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ListType -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ListType -> r)
-> (forall u. (forall d. Data d => d -> u) -> ListType -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> ListType -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ListType -> m ListType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ListType -> m ListType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ListType -> m ListType)
-> Data ListType
ListType -> DataType
ListType -> Constr
(forall b. Data b => b -> b) -> ListType -> ListType
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListType -> c ListType
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ListType
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ListType -> u
forall u. (forall d. Data d => d -> u) -> ListType -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListType -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListType -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ListType -> m ListType
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ListType -> m ListType
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ListType
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListType -> c ListType
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ListType)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ListType)
$cOrderedList :: Constr
$cBulletList :: Constr
$tListType :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ListType -> m ListType
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ListType -> m ListType
gmapMp :: (forall d. Data d => d -> m d) -> ListType -> m ListType
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ListType -> m ListType
gmapM :: (forall d. Data d => d -> m d) -> ListType -> m ListType
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ListType -> m ListType
gmapQi :: Int -> (forall d. Data d => d -> u) -> ListType -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ListType -> u
gmapQ :: (forall d. Data d => d -> u) -> ListType -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ListType -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListType -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListType -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListType -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListType -> r
gmapT :: (forall b. Data b => b -> b) -> ListType -> ListType
$cgmapT :: (forall b. Data b => b -> b) -> ListType -> ListType
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ListType)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ListType)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ListType)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ListType)
dataTypeOf :: ListType -> DataType
$cdataTypeOf :: ListType -> DataType
toConstr :: ListType -> Constr
$ctoConstr :: ListType -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ListType
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ListType
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListType -> c ListType
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListType -> c ListType
$cp1Data :: Typeable ListType
Data, Typeable)

class (Monoid a, Show a, Rangeable a, HasAttributes a) => IsInline a where
  lineBreak :: a
  softBreak :: a
  str :: Text -> a
  entity :: Text -> a
  escapedChar :: Char -> a
  emph :: a -> a
  strong :: a -> a
  link :: Text -- ^ Destination
       -> Text -- ^ Title
       -> a    -- ^ Link description
       -> a
  image :: Text -- ^ Source
        -> Text -- ^ Title
        -> a    -- ^ Description
        -> a
  code :: Text -> a
  rawInline :: Format -> Text -> a

class (Monoid b, Show b, Rangeable b, IsInline il, HasAttributes b)
      => IsBlock il b | b -> il where
  paragraph :: il -> b
  plain :: il -> b
  thematicBreak :: b
  blockQuote :: b -> b
  codeBlock :: Text -> Text -> b
  heading :: Int -- ^ Level
          -> il  -- ^ text
          -> b
  rawBlock :: Format -> Text -> b
  referenceLinkDefinition :: Text -- ^ Label
                          -> (Text, Text) -- ^ Destination, title
                          -> b
  list :: ListType -> ListSpacing -> [b] -> b

newtype SourceRange = SourceRange
        { SourceRange -> [(SourcePos, SourcePos)]
unSourceRange :: [(SourcePos, SourcePos)] }
  deriving (SourceRange -> SourceRange -> Bool
(SourceRange -> SourceRange -> Bool)
-> (SourceRange -> SourceRange -> Bool) -> Eq SourceRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceRange -> SourceRange -> Bool
$c/= :: SourceRange -> SourceRange -> Bool
== :: SourceRange -> SourceRange -> Bool
$c== :: SourceRange -> SourceRange -> Bool
Eq, Eq SourceRange
Eq SourceRange
-> (SourceRange -> SourceRange -> Ordering)
-> (SourceRange -> SourceRange -> Bool)
-> (SourceRange -> SourceRange -> Bool)
-> (SourceRange -> SourceRange -> Bool)
-> (SourceRange -> SourceRange -> Bool)
-> (SourceRange -> SourceRange -> SourceRange)
-> (SourceRange -> SourceRange -> SourceRange)
-> Ord SourceRange
SourceRange -> SourceRange -> Bool
SourceRange -> SourceRange -> Ordering
SourceRange -> SourceRange -> SourceRange
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: SourceRange -> SourceRange -> SourceRange
$cmin :: SourceRange -> SourceRange -> SourceRange
max :: SourceRange -> SourceRange -> SourceRange
$cmax :: SourceRange -> SourceRange -> SourceRange
>= :: SourceRange -> SourceRange -> Bool
$c>= :: SourceRange -> SourceRange -> Bool
> :: SourceRange -> SourceRange -> Bool
$c> :: SourceRange -> SourceRange -> Bool
<= :: SourceRange -> SourceRange -> Bool
$c<= :: SourceRange -> SourceRange -> Bool
< :: SourceRange -> SourceRange -> Bool
$c< :: SourceRange -> SourceRange -> Bool
compare :: SourceRange -> SourceRange -> Ordering
$ccompare :: SourceRange -> SourceRange -> Ordering
$cp1Ord :: Eq SourceRange
Ord, Typeable SourceRange
DataType
Constr
Typeable SourceRange
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> SourceRange -> c SourceRange)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SourceRange)
-> (SourceRange -> Constr)
-> (SourceRange -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SourceRange))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c SourceRange))
-> ((forall b. Data b => b -> b) -> SourceRange -> SourceRange)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SourceRange -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SourceRange -> r)
-> (forall u. (forall d. Data d => d -> u) -> SourceRange -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SourceRange -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> SourceRange -> m SourceRange)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SourceRange -> m SourceRange)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SourceRange -> m SourceRange)
-> Data SourceRange
SourceRange -> DataType
SourceRange -> Constr
(forall b. Data b => b -> b) -> SourceRange -> SourceRange
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SourceRange -> c SourceRange
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SourceRange
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> SourceRange -> u
forall u. (forall d. Data d => d -> u) -> SourceRange -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SourceRange -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SourceRange -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SourceRange -> m SourceRange
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SourceRange -> m SourceRange
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SourceRange
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SourceRange -> c SourceRange
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SourceRange)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SourceRange)
$cSourceRange :: Constr
$tSourceRange :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> SourceRange -> m SourceRange
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SourceRange -> m SourceRange
gmapMp :: (forall d. Data d => d -> m d) -> SourceRange -> m SourceRange
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SourceRange -> m SourceRange
gmapM :: (forall d. Data d => d -> m d) -> SourceRange -> m SourceRange
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SourceRange -> m SourceRange
gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceRange -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SourceRange -> u
gmapQ :: (forall d. Data d => d -> u) -> SourceRange -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SourceRange -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SourceRange -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SourceRange -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SourceRange -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SourceRange -> r
gmapT :: (forall b. Data b => b -> b) -> SourceRange -> SourceRange
$cgmapT :: (forall b. Data b => b -> b) -> SourceRange -> SourceRange
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SourceRange)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SourceRange)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c SourceRange)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SourceRange)
dataTypeOf :: SourceRange -> DataType
$cdataTypeOf :: SourceRange -> DataType
toConstr :: SourceRange -> Constr
$ctoConstr :: SourceRange -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SourceRange
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SourceRange
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SourceRange -> c SourceRange
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SourceRange -> c SourceRange
$cp1Data :: Typeable SourceRange
Data, Typeable)

instance Semigroup SourceRange where
  (SourceRange [(SourcePos, SourcePos)]
xs) <> :: SourceRange -> SourceRange -> SourceRange
<> (SourceRange [(SourcePos, SourcePos)]
ys) =
    [(SourcePos, SourcePos)] -> SourceRange
SourceRange ([(SourcePos, SourcePos)]
-> [(SourcePos, SourcePos)] -> [(SourcePos, SourcePos)]
forall a. Eq a => [(a, a)] -> [(a, a)] -> [(a, a)]
consolidateRanges [(SourcePos, SourcePos)]
xs [(SourcePos, SourcePos)]
ys)

instance Monoid SourceRange where
  mempty :: SourceRange
mempty = [(SourcePos, SourcePos)] -> SourceRange
SourceRange [(SourcePos, SourcePos)]
forall a. Monoid a => a
mempty
  mappend :: SourceRange -> SourceRange -> SourceRange
mappend = SourceRange -> SourceRange -> SourceRange
forall a. Semigroup a => a -> a -> a
(<>)

consolidateRanges :: Eq a => [(a,a)] -> [(a,a)] -> [(a,a)]
consolidateRanges :: [(a, a)] -> [(a, a)] -> [(a, a)]
consolidateRanges [] [(a, a)]
xs = [(a, a)]
xs
consolidateRanges [(a, a)]
xs [] = [(a, a)]
xs
consolidateRanges xs :: [(a, a)]
xs@((a, a)
_:[(a, a)]
_) ((a
s2,a
e2):[(a, a)]
ys) =
  if a
e1 a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
s2
     then [(a, a)] -> [(a, a)]
forall a. [a] -> [a]
init [(a, a)]
xs [(a, a)] -> [(a, a)] -> [(a, a)]
forall a. [a] -> [a] -> [a]
++ (a
s1,a
e2)(a, a) -> [(a, a)] -> [(a, a)]
forall a. a -> [a] -> [a]
:[(a, a)]
ys
     else [(a, a)]
xs [(a, a)] -> [(a, a)] -> [(a, a)]
forall a. [a] -> [a] -> [a]
++ (a
s2,a
e2)(a, a) -> [(a, a)] -> [(a, a)]
forall a. a -> [a] -> [a]
:[(a, a)]
ys
  where (a
s1,a
e1) = [(a, a)] -> (a, a)
forall a. [a] -> a
last [(a, a)]
xs

instance Show SourceRange where
  show :: SourceRange -> String
show = SourceRange -> String
prettyRange

class Rangeable a where
  ranged :: SourceRange -> a -> a

prettyRange :: SourceRange -> String
prettyRange :: SourceRange -> String
prettyRange (SourceRange [(SourcePos, SourcePos)]
xs) = String -> [(SourcePos, SourcePos)] -> String
go String
"" [(SourcePos, SourcePos)]
xs
  where
    go :: String -> [(SourcePos, SourcePos)] -> String
go String
_ [] = String
""
    go String
curname ((SourcePos
p1,SourcePos
p2):[(SourcePos, SourcePos)]
rest)
      = (if SourcePos -> String
sourceName SourcePos
p1 String -> String -> Bool
forall a. Eq a => a -> a -> Bool
/= String
curname
            then SourcePos -> String
sourceName SourcePos
p1 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"@"
            else String
"") String -> ShowS
forall a. [a] -> [a] -> [a]
++
         Int -> String
forall a. Show a => a -> String
show (SourcePos -> Int
sourceLine SourcePos
p1) String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
":" String -> ShowS
forall a. [a] -> [a] -> [a]
++
         Int -> String
forall a. Show a => a -> String
show (SourcePos -> Int
sourceColumn SourcePos
p1) String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"-" String -> ShowS
forall a. [a] -> [a] -> [a]
++
         (if SourcePos -> String
sourceName SourcePos
p2 String -> String -> Bool
forall a. Eq a => a -> a -> Bool
/= SourcePos -> String
sourceName SourcePos
p1
             then SourcePos -> String
sourceName SourcePos
p2 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"@"
             else String
"") String -> ShowS
forall a. [a] -> [a] -> [a]
++
         Int -> String
forall a. Show a => a -> String
show (SourcePos -> Int
sourceLine SourcePos
p2) String -> ShowS
forall a. [a] -> [a] -> [a]
++
         String
":" String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (SourcePos -> Int
sourceColumn SourcePos
p2) String -> ShowS
forall a. [a] -> [a] -> [a]
++
         if [(SourcePos, SourcePos)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [(SourcePos, SourcePos)]
rest
            then String
""
            else String
";" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String -> [(SourcePos, SourcePos)] -> String
go (SourcePos -> String
sourceName SourcePos
p2) [(SourcePos, SourcePos)]
rest

type Attribute = (Text, Text)

type Attributes = [Attribute]

class HasAttributes a where
  addAttributes :: Attributes -> a -> a

class ToPlainText a where
  toPlainText :: a -> Text