@@ -14,11 +14,11 @@ module Streamly.Internal.Unicode.Char.Parser
15 -- * Generic
15 -- * Generic
17− , charAnyCase
17+ , charIgnoreCase
19 -- * Sequences
19 -- * Sequences
21− , stringAnyCase
21+ , stringIgnoreCase
22 , dropSpace
22 , dropSpace
23 , dropSpace1
23 , dropSpace1
@@ -33,7 +33,7 @@ module Streamly.Internal.Unicode.Char.Parser
36− , print
36+ , printable
37 , punctuation
37 , punctuation
38 , separator
38 , separator
@@ -43,7 +43,7 @@ module Streamly.Internal.Unicode.Char.Parser
44 , octDigit
44 , octDigit
45 , hexDigit
45 , hexDigit
46− , number
46+ , numeric
48 -- * Numeric
48 -- * Numeric
@@ -57,7 +57,6 @@ import Control.Applicative (Alternative(..))
57import Control.Monad.Catch (MonadCatch)
57import Control.Monad.Catch (MonadCatch)
58import Data.Bits (Bits, (.|.), shiftL)
58import Data.Bits (Bits, (.|.), shiftL)
59import Data.Char (ord)
59import Data.Char (ord)
60−import Prelude hiding (print)
61import Streamly.Internal.Data.Parser (Parser)
60import Streamly.Internal.Data.Parser (Parser)
63import qualified Data.Char as Char
62import qualified Data.Char as Char
@@ -77,7 +76,7 @@ import qualified Streamly.Internal.Data.Parser as Parser
78-- XXX It may be possible to implement faster predicates for ASCII byte stream.
77-- XXX It may be possible to implement faster predicates for ASCII byte stream.
79-- We can measure if there is a signficant difference and if so we can add such
78-- We can measure if there is a signficant difference and if so we can add such
80−-- predicates to Streamly.Unicode.Char.Parser.Latin1.
79+-- predicates to Streamly.Unicode.Parser.Latin1.
82#define CHAR_PARSER_SIG(NAME) NAME :: MonadCatch m => Parser m Char Char
81#define CHAR_PARSER_SIG(NAME) NAME :: MonadCatch m => Parser m Char Char
83-- XXX Need to use the predicates from Unicode.Char module/unicode-data package
82-- XXX Need to use the predicates from Unicode.Char module/unicode-data package
@@ -101,8 +100,8 @@ CHAR_PARSER(alpha,isAlpha)
101CHAR_PARSER_SIG(alphaNum)
100CHAR_PARSER_SIG(alphaNum)
102CHAR_PARSER(alphaNum,isAlphaNum)
101CHAR_PARSER(alphaNum,isAlphaNum)
104−CHAR_PARSER_SIG(print)
103+CHAR_PARSER_SIG(printable)
105−CHAR_PARSER(print,isPrint)
104+CHAR_PARSER(printable,isPrint)
107CHAR_PARSER_SIG(digit)
106CHAR_PARSER_SIG(digit)
108CHAR_PARSER(digit,isDigit)
107CHAR_PARSER(digit,isDigit)
@@ -119,8 +118,8 @@ CHAR_PARSER(letter,isLetter)
119CHAR_PARSER_SIG(mark)
118CHAR_PARSER_SIG(mark)
120CHAR_PARSER(mark,isMark)
119CHAR_PARSER(mark,isMark)
122−CHAR_PARSER_SIG(number)
121+CHAR_PARSER_SIG(numeric)
123−CHAR_PARSER(number,isNumber)
122+CHAR_PARSER(numeric,isNumber)
125CHAR_PARSER_SIG(punctuation)
124CHAR_PARSER_SIG(punctuation)
126CHAR_PARSER(punctuation,isPunctuation)
125CHAR_PARSER(punctuation,isPunctuation)
@@ -154,9 +153,9 @@ char c = Parser.satisfy (== c)
155-- XXX Case conversion may lead to change in number of chars
154-- XXX Case conversion may lead to change in number of chars
156-- | Match a specific character ignoring case.
155-- | Match a specific character ignoring case.
157−{-# INLINE charAnyCase #-}
156+{-# INLINE charIgnoreCase #-}
158−charAnyCase :: MonadCatch m => Char -> Parser m Char Char
157+charIgnoreCase :: MonadCatch m => Char -> Parser m Char Char
159−charAnyCase c = Parser.lmap Char.toLower (Parser.satisfy (== Char.toLower c))
158+charIgnoreCase c = Parser.lmap Char.toLower (Parser.satisfy (== Char.toLower c))
161--------------------------------------------------------------------------------
160--------------------------------------------------------------------------------
162-- Character sequences
161-- Character sequences
@@ -168,8 +167,8 @@ string = Parser.list
169-- XXX Not accurate unicode case conversion
168-- XXX Not accurate unicode case conversion
170-- | Match the input with the supplied string and return it if successful.
169-- | Match the input with the supplied string and return it if successful.
171−stringAnyCase :: MonadCatch m => String -> Parser m Char String
170+stringIgnoreCase :: MonadCatch m => String -> Parser m Char String
172−stringAnyCase s = Parser.lmap Char.toLower (Parser.list (map Char.toLower s))
171+stringIgnoreCase s = Parser.lmap Char.toLower (Parser.list (map Char.toLower s))
174-- | Drop /zero/ or more white space characters.
173-- | Drop /zero/ or more white space characters.
175dropSpace :: MonadCatch m => Parser m Char ()
174dropSpace :: MonadCatch m => Parser m Char ()