Portability | portable |
---|---|
Stability | experimental |
Maintainer | rhymoid@gmail.com |
Safe Haskell | None |
- unlit :: Text -> ([UnlitError], Text)
- data UnlitError
- unlitWith :: [Parser Text] -> Text -> ([UnlitError], Text)
- unlitLinesWith :: [Parser Text] -> [Text] -> ([UnlitError], [Text])
- ghcParsers :: [Parser Text]
- latexParser :: Parser Text
- birdParser :: Parser Text
- cppParser :: Parser Text
- pandocMarkdownParser :: (Text -> Active) -> Parser Text
- newtype Parser x = Parser (x -> [x] -> Maybe ([Classified x], Maybe [x]))
- data Classified x
- data NeedHug
- data Active
- lines :: Text -> [Text]
- unlines :: [Text] -> Text
unlit
unlit :: Text -> ([UnlitError], Text)Source
Runs unlitWith
, using the default parsers of GHC.
unlitWith :: [Parser Text] -> Text -> ([UnlitError], Text)Source
Runs unlitLinesWith
, with the provided Text
split into lines
unlitLinesWith :: [Parser Text] -> [Text] -> ([UnlitError], [Text])Source
Parse a list of lines, given a sequence of parsers.
Parsers
ghcParsers :: [Parser Text]Source
The default parsers used by GHC (latexParser
, birdParser
, and cppParser
).
latexParser :: Parser TextSource
Parser for blocks of code delimited by \begin{code}
and \end{code}
or \begin{pseudocode}
and \end{pseudocode}
.
birdParser :: Parser TextSource
Parser for blocks of code prefixed by >
or <
.
pandocMarkdownParser :: (Text -> Active) -> Parser TextSource
Parser for lines fenced by backticks or tildes.
Defining custom parsers
data Classified x Source
Splitting and joining lines
Breaks a Text
up into a list of Text
s at newline sequences.
The resulting strings do not contain newline sequences.
This function accepts '\r\n'
, '\r'
and '\n'
as newline sequences.