| Safe Haskell | Safe-Infered |
|---|
Text.XmlHtml.TextParser
- guessEncoding :: ByteString -> (Encoding, ByteString)
- parse :: (Encoding -> Parser a) -> String -> ByteString -> Either String a
- isValidChar :: Char -> Bool
- parseText :: Parser a -> String -> Text -> Either String a
- takeWhile0 :: (Char -> Bool) -> Parser Text
- takeWhile1 :: (Char -> Bool) -> Parser Text
- text :: Text -> Parser Text
- scanText :: (Char -> ScanState) -> Parser String
- data ScanState
- module Text.Parsec.Text
Documentation
guessEncoding :: ByteString -> (Encoding, ByteString)Source
Get an initial guess at document encoding from the byte order mark. If the mark doesn't exist, guess UTF-8. Otherwise, guess according to the mark.
isValidChar :: Char -> BoolSource
Checks if a document contains invalid characters.
Arguments
| :: Parser a | The parser to match |
| -> String | Name of the source file (can be |
| -> Text | Text to parse |
| -> Either String a |
Parses a Text value and gives back the result. The parser is expected
to match the entire string.
takeWhile0 :: (Char -> Bool) -> Parser TextSource
Consume input as long as the predicate returns True, and return the
consumed input. This parser does not fail. If it matches no input, it
will return an empty string.
takeWhile1 :: (Char -> Bool) -> Parser TextSource
Consume input as long as the predicate returns True, and return the
consumed input. This parser requires the predicate to succeed on at least
one character of input. It will fail if the first character fails the
predicate.
text :: Text -> Parser TextSource
The equivalent of Parsec's string combinator, but for text. If there is
not a complete match, then no input is consumed. This matches the behavior
of string from the attoparsec-text package.
scanText :: (Char -> ScanState) -> Parser StringSource
Scans text and progresses through a DFA, collecting the complete matching text as it goes.
Represents the state of a text scanner, for use with the scanText
parser combinator.
module Text.Parsec.Text