Module

StringParser.CodePoints

Package
purescript-string-parsers
Repository
purescript-contrib/purescript-string-parsers

Primitive parsers for strings, parsing based on code points.

These functions will be much slower than the CodeUnits alternatives, but will behave correctly in the presence of Unicode characters made up of multiple code units.

#eof Source

eof :: Parser Unit

Match the end of the file.

#anyChar Source

anyChar :: Parser Char

Match any character from the Basic Multilingual Plane.

#anyCodePoint Source

anyCodePoint :: Parser CodePoint

Match any code point.

#anyDigit Source

anyDigit :: Parser Char

Match any digit.

#string Source

string :: String -> Parser String

Match the specified string.

#satisfy Source

satisfy :: (Char -> Boolean) -> Parser Char

Match a character satisfying the given predicate.

#satisfyCodePoint Source

satisfyCodePoint :: (CodePoint -> Boolean) -> Parser CodePoint

Match a code point satisfying the given predicate.

#char Source

char :: Char -> Parser Char

Match the specified character.

#codePoint Source

codePoint :: CodePoint -> Parser CodePoint

Match the specified code point.

#whiteSpace Source

whiteSpace :: Parser String

Match many whitespace characters.

#skipSpaces Source

skipSpaces :: Parser Unit

Skip many whitespace characters.

#oneOf Source

oneOf :: forall f. Foldable f => f Char -> Parser Char

Match one of the characters in the foldable structure.

#noneOf Source

noneOf :: forall f. Foldable f => f Char -> Parser Char

Match any character not in the foldable structure.

#lowerCaseChar Source

lowerCaseChar :: Parser Char

Match any lower case character.

#upperCaseChar Source

upperCaseChar :: Parser Char

Match any upper case character.

#anyLetter Source

anyLetter :: Parser Char

Match any letter.

#alphaNum Source

alphaNum :: Parser Char

Match a letter or a number.

#regex Source

regex :: String -> Parser String

match the regular expression