Commit bc0b3c3f authored by Baruffaldi Bruno's avatar Baruffaldi Bruno Committed by Herbert Valerio Riedel

Fix/clarify documentation of alphaNum/letter/digit

This rewording makes it clear that `alphaNum` and `letter` refer to the Unicode domain
whereas the `digit` parser refers to the digits contained in the ASCII subset.

Addresses #98 
parent 0dc8af76
......@@ -89,19 +89,24 @@ upper = satisfy isUpper <?> "uppercase letter"
lower :: (Stream s m Char) => ParsecT s u m Char
lower = satisfy isLower <?> "lowercase letter"
-- | Parses a letter or digit (a character between \'0\' and \'9\')
-- | Parses a alphabetic or numeric Unicode characters
-- according to 'isAlphaNum'. Returns the parsed character.
--
-- Note that numeric digits outside the ASCII range (such as arabic-indic digits like e.g. \"٤\" or @U+0664@),
-- as well as numeric characters which aren't digits, are parsed by this function
-- but not by 'digit'.
alphaNum :: (Stream s m Char => ParsecT s u m Char)
alphaNum = satisfy isAlphaNum <?> "letter or digit"
-- | Parses a letter (an upper case or lower case character according
-- to 'isAlpha'). Returns the parsed character.
-- | Parses an alphabetic Unicode characters (lower-case, upper-case and title-case letters,
-- plus letters of caseless scripts and modifiers letters according to 'isAlpha').
-- Returns the parsed character.
letter :: (Stream s m Char) => ParsecT s u m Char
letter = satisfy isAlpha <?> "letter"
-- | Parses a digit. Returns the parsed character.
-- | Parses an ASCII digit. Returns the parsed character.
digit :: (Stream s m Char) => ParsecT s u m Char
digit = satisfy isDigit <?> "digit"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment