- rangeLettersToSymbols :: Char -> Bool
- rangeLetters :: Char -> Bool
- rangeMathCurrency :: Char -> Bool
- rangeSymbols :: Char -> Bool
- rangeLettersNumbers :: Char -> Bool
- lexeme :: Parser a -> Parser a
- eol :: Parser ()
- spaces :: Parser ()
- checkText :: HasText a => NonEmpty (Char -> Bool, b) -> a -> Maybe b
- listIsOK :: HasTextNonEmptyList a => (Char -> Bool) -> a -> Bool
- firstCharOfListIsOK :: HasTextNonEmptyList a => (Char -> Bool) -> a -> Bool
- renMaybe :: Maybe a -> (a -> Maybe Text) -> Maybe Text
- txtWords :: [Text] -> Text
Creates a new parser that behaves like the old one, but also parses any whitespace remaining afterward.
Parses any trailing whitespace followed by a newline followed by additional whitespace.
Applied to a non-empty list of pairs, with the first element of the pair being a predicate that returns True if a character is OK and the second element being something of an arbitrary type, and to something that has a Text. The pairs must be ordered from most restrictive to least restrictive predicates. If at least one of the predicates indicates that the Text is valid, returns the leftmost b associated with that predicate. If none of the predicates indicates that the Text is valid, returns the rightmost error.
Here, most restrictive means the predicate that indicates True for the narrowest range of characters, while least restrictive means the predicate that indicates True for the widest range of characters.
Takes a field that may or may not be present and a function that renders it. If the field is not present at all, returns an empty Text. Otherwise will succeed or fail depending upon whether the rendering function succeeds or fails.