module Bookhound.Parsers.Char (module AnyChar, digit, hexDigit, octDigit, upper, lower, alpha, alphaNum, space, tab, newLine, spaceOrTab, whiteSpace, comma, dot, colon, quote, doubleQuote, dash, plus, equal, underscore, hashTag, question, openParens, closeParens, openSquare, closeSquare, openCurly, closeCurly, openAngle, closeAngle) where import qualified Bookhound.Parser as AnyChar (anyChar) import qualified Bookhound.Parser as Parser import Bookhound.ParserCombinators (IsMatch (..)) import Bookhound.Parser (Parser, anyChar) import Control.Applicative import Data.Char (isAsciiLower, isAsciiUpper, isDigit, isHexDigit, isOctDigit) digit :: Parser Char digit :: Parser Char digit = (Char -> Bool) -> Parser Char satisfy Char -> Bool isDigit hexDigit :: Parser Char hexDigit :: Parser Char hexDigit = (Char -> Bool) -> Parser Char satisfy Char -> Bool isHexDigit octDigit :: Parser Char octDigit :: Parser Char octDigit = (Char -> Bool) -> Parser Char satisfy Char -> Bool isOctDigit upper :: Parser Char upper :: Parser Char upper = (Char -> Bool) -> Parser Char satisfy Char -> Bool isAsciiUpper lower :: Parser Char lower :: Parser Char lower = (Char -> Bool) -> Parser Char satisfy Char -> Bool isAsciiLower alpha :: Parser Char alpha :: Parser Char alpha = (Char -> Bool) -> Parser Char satisfy Char -> Bool isAlpha alphaNum :: Parser Char alphaNum :: Parser Char alphaNum = (Char -> Bool) -> Parser Char satisfy Char -> Bool isAlphaNum space :: Parser Char space :: Parser Char space = forall a. IsMatch a => a -> Parser a is Char ' ' tab :: Parser Char tab :: Parser Char tab = forall a. IsMatch a => a -> Parser a is Char '\t' spaceOrTab :: Parser Char spaceOrTab :: Parser Char spaceOrTab = Parser Char space forall (f :: * -> *) a. Alternative f => f a -> f a -> f a <|> Parser Char tab whiteSpace :: Parser Char whiteSpace :: Parser Char whiteSpace = Parser Char space forall (f :: * -> *) a. Alternative f => f a -> f a -> f a <|> Parser Char tab forall (f :: * -> *) a. Alternative f => f a -> f a -> f a <|> Parser Char newLine newLine :: Parser Char newLine :: Parser Char newLine = forall a. IsMatch a => a -> Parser a is Char '\n' comma :: Parser Char comma :: Parser Char comma = forall a. IsMatch a => a -> Parser a is Char ',' dot :: Parser Char dot :: Parser Char dot = forall a. IsMatch a => a -> Parser a is Char '.' colon :: Parser Char colon :: Parser Char colon = forall a. IsMatch a => a -> Parser a is Char ':' quote :: Parser Char quote :: Parser Char quote = forall a. IsMatch a => a -> Parser a is Char '\'' doubleQuote :: Parser Char doubleQuote :: Parser Char doubleQuote = forall a. IsMatch a => a -> Parser a is Char '"' dash :: Parser Char dash :: Parser Char dash = forall a. IsMatch a => a -> Parser a is Char '-' plus :: Parser Char plus :: Parser Char plus = forall a. IsMatch a => a -> Parser a is Char '+' equal :: Parser Char equal :: Parser Char equal = forall a. IsMatch a => a -> Parser a is Char '=' underscore :: Parser Char underscore :: Parser Char underscore = forall a. IsMatch a => a -> Parser a is Char '_' hashTag :: Parser Char hashTag :: Parser Char hashTag = forall a. IsMatch a => a -> Parser a is Char '#' question :: Parser Char question :: Parser Char question = forall a. IsMatch a => a -> Parser a is Char '?' openParens :: Parser Char openParens :: Parser Char openParens = forall a. IsMatch a => a -> Parser a is Char '(' closeParens :: Parser Char closeParens :: Parser Char closeParens = forall a. IsMatch a => a -> Parser a is Char ')' openSquare :: Parser Char openSquare :: Parser Char openSquare = forall a. IsMatch a => a -> Parser a is Char '[' closeSquare :: Parser Char closeSquare :: Parser Char closeSquare = forall a. IsMatch a => a -> Parser a is Char ']' openCurly :: Parser Char openCurly :: Parser Char openCurly = forall a. IsMatch a => a -> Parser a is Char '{' closeCurly :: Parser Char closeCurly :: Parser Char closeCurly = forall a. IsMatch a => a -> Parser a is Char '}' openAngle :: Parser Char openAngle :: Parser Char openAngle = forall a. IsMatch a => a -> Parser a is Char '<' closeAngle :: Parser Char closeAngle :: Parser Char closeAngle = forall a. IsMatch a => a -> Parser a is Char '>' isAlpha :: Char -> Bool isAlpha :: Char -> Bool isAlpha Char x = Char -> Bool isAsciiLower Char x Bool -> Bool -> Bool || Char -> Bool isAsciiUpper Char x isAlphaNum :: Char -> Bool isAlphaNum :: Char -> Bool isAlphaNum Char x = Char -> Bool isAlpha Char x Bool -> Bool -> Bool || Char -> Bool isDigit Char x satisfy :: (Char -> Bool) -> Parser Char satisfy :: (Char -> Bool) -> Parser Char satisfy = forall a b c. (a -> b -> c) -> b -> a -> c flip forall a. (a -> Bool) -> Parser a -> Parser a Parser.satisfy Parser Char anyChar