Module

Parsing.String.Basic

Package
purescript-parsing
Repository
purescript-contrib/purescript-parsing

Basic String parsers derived from primitive String parsers.

#digit Source

digit :: forall m. ParserT String m Char

Parse a digit. Matches any char that satisfies Data.CodePoint.Unicode.isDecDigit.

#hexDigit Source

hexDigit :: forall m. ParserT String m Char

Parse a hex digit. Matches any char that satisfies Data.CodePoint.Unicode.isHexDigit.

#octDigit Source

octDigit :: forall m. ParserT String m Char

Parse an octal digit. Matches any char that satisfies Data.CodePoint.Unicode.isOctDigit.

#letter Source

letter :: forall m. ParserT String m Char

Parse an alphabetical character. Matches any char that satisfies Data.CodePoint.Unicode.isAlpha.

#space Source

space :: forall m. ParserT String m Char

Parse a space character. Matches any char that satisfies Data.CodePoint.Unicode.isSpace.

#lower Source

lower :: forall m. ParserT String m Char

Parse a lowercase letter. Matches any char that satisfies Data.CodePoint.Unicode.isLower.

#upper Source

upper :: forall m. ParserT String m Char

Parse an uppercase letter. Matches any char that satisfies Data.CodePoint.Unicode.isUpper.

#alphaNum Source

alphaNum :: forall m. ParserT String m Char

Parse an alphabetical or numerical character. Matches any char that satisfies Data.CodePoint.Unicode.isAlphaNum.

#intDecimal Source

intDecimal :: forall m. ParserT String m Int

Parser based on the Data.Int.fromString function.

This should be the inverse of show :: String -> Int.

Examples of strings which can be parsed by this parser:

  • "3"
  • "-3"
  • "+300"

#number Source

number :: forall m. ParserT String m Number

Parser based on the Data.Number.fromString function.

This should be the inverse of show :: String -> Number.

Examples of strings which can be parsed by this parser:

  • "3"
  • "3.0"
  • "0.3"
  • "-0.3"
  • "+0.3"
  • "-3e-1"
  • "-3.0E-1.0"
  • "NaN"
  • "-Infinity"

#whiteSpace Source

whiteSpace :: forall m. ParserT String m String

Match zero or more whitespace characters satisfying Data.CodePoint.Unicode.isSpace. Always succeeds.

#skipSpaces Source

skipSpaces :: forall m. ParserT String m Unit

Skip whitespace characters and throw them away. Always succeeds.

#oneOf Source

oneOf :: forall m. Array Char -> ParserT String m Char

Match one of the BMP Chars in the array.

#oneOfCodePoints Source

oneOfCodePoints :: forall m. Array CodePoint -> ParserT String m CodePoint

Match one of the Unicode characters in the array.

#noneOf Source

noneOf :: forall m. Array Char -> ParserT String m Char

Match any BMP Char not in the array.

#noneOfCodePoints Source

noneOfCodePoints :: forall m. Array CodePoint -> ParserT String m CodePoint

Match any Unicode character not in the array.