-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | A simple applicative parser
--   
--   A simple applicative parser in Parsec style
@package appar
@version 0.1.8

-- | Simple Applicative parser whose input is lazy
--   ByteString. The usage is the same as parsec.
--   
--   Parsec 3 provides features which Parsec 2 does not provide:
--   
--   
--   
- Applicative style
--   
- ByteString as input
--   
--   
--   But Haskell Platform includes Parsec 2, not Parsec 3. Installing
--   Parsec 3 to Haskell Platform environment makes it mess. So, this
--   library was implemented.
module Text.Appar.LazyByteString

-- | Parser synonym for strict ByteString.
type Parser = MkParser ByteString

-- | Sequential application.
--   
--   A few functors support an implementation of <*> that is
--   more efficient than the default one.
--   
--   
Example
--   
--   Used in combination with (<$>),
--   (<*>) can be used to build a record.
--   
--   
--   >>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}
--   
--   
--   
--   >>> produceFoo :: Applicative f => f Foo
--   
--   >>> produceBar :: Applicative f => f Bar
--   
--   >>> produceBaz :: Applicative f => f Baz
--   
--   
--   
--   >>> mkState :: Applicative f => f MyState
--   
--   >>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz
--   
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
infixl 4 <*>

-- | Lift a value into the Structure.
--   
--   
Examples
--   
--   
--   >>> pure 1 :: Maybe Int
--   Just 1
--   
--   
--   
--   >>> pure 'z' :: [Char]
--   "z"
--   
--   
--   
--   >>> pure (pure ":D") :: Maybe [String]
--   Just [":D"]
--   
pure :: Applicative f => a -> f a

-- | Sequence actions, discarding the value of the first argument.
--   
--   
Examples
--   
--   If used in conjunction with the Applicative instance for Maybe,
--   you can chain Maybe computations, with a possible "early return" in
--   case of Nothing.
--   
--   
--   >>> Just 2 *> Just 3
--   Just 3
--   
--   
--   
--   >>> Nothing *> Just 3
--   Nothing
--   
--   
--   Of course a more interesting use case would be to have effectful
--   computations instead of just returning pure values.
--   
--   
--   >>> import Data.Char
--   
--   >>> import GHC.Internal.Text.ParserCombinators.ReadP
--   
--   >>> let p = string "my name is " *> munch1 isAlpha <* eof
--   
--   >>> readP_to_S p "my name is Simon"
--   [("Simon","")]
--   
(*>) :: Applicative f => f a -> f b -> f b
infixl 4 *>

-- | Sequence actions, discarding the value of the second argument.
(<*) :: Applicative f => f a -> f b -> f a
infixl 4 <*

-- | An associative binary operation
(<|>) :: Alternative f => f a -> f a -> f a
infixl 3 <|>

-- | One or more.
--   
--   
Examples
--   
--   
--   >>> some (putStr "la")
--   lalalalalalalalala... * goes on forever *
--   
--   
--   
--   >>> some Nothing
--   nothing
--   
--   
--   
--   >>> take 5 <$> some (Just 1)
--   * hangs forever *
--   
--   
--   Note that this function can be used with Parsers based on
--   Applicatives. In that case some parser will attempt to parse
--   parser one or more times until it fails.
some :: Alternative f => f a -> f [a]

-- | Zero or more.
--   
--   
Examples
--   
--   
--   >>> many (putStr "la")
--   lalalalalalalalala... * goes on forever *
--   
--   
--   
--   >>> many Nothing
--   Just []
--   
--   
--   
--   >>> take 5 <$> many (Just 1)
--   * hangs forever *
--   
--   
--   Note that this function can be used with Parsers based on
--   Applicatives. In that case many parser will attempt to parse
--   parser zero or more times until it fails.
many :: Alternative f => f a -> f [a]

-- | Replace all locations in the input with the same value. The default
--   definition is fmap . const, but this may be
--   overridden with a more efficient version.
--   
--   
Examples
--   
--   Perform a computation with Maybe and replace the result with a
--   constant value if it is Just:
--   
--   
--   >>> 'a' <$ Just 2
--   Just 'a'
--   
--   >>> 'a' <$ Nothing
--   Nothing
--   
(<$) :: Functor f => a -> f b -> f a
infixl 4 <$

-- | A variant of <*> with the types of the arguments
--   reversed. It differs from flip (<*>) in
--   that the effects are resolved in the order the arguments are
--   presented.
--   
--   
Examples
--   
--   
--   >>> (<**>) (print 1) (id <$ print 2)
--   1
--   2
--   
--   
--   
--   >>> flip (<*>) (print 1) (id <$ print 2)
--   2
--   1
--   
--   
--   
--   >>> ZipList [4, 5, 6] <**> ZipList [(+1), (*2), (/3)]
--   ZipList {getZipList = [5.0,10.0,2.0]}
--   
(<**>) :: Applicative f => f a -> f (a -> b) -> f b
infixl 4 <**>

-- | An infix synonym for fmap.
--   
--   The name of this operator is an allusion to $. Note the
--   similarities between their types:
--   
--   
--    ($)  ::              (a -> b) ->   a ->   b
--   (<$>) :: Functor f => (a -> b) -> f a -> f b
--   
--   
--   Whereas $ is function application, <$> is function
--   application lifted over a Functor.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe
--   String using show:
--   
--   
--   >>> show <$> Nothing
--   Nothing
--   
--   
--   
--   >>> show <$> Just 3
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an
--   Either Int String using show:
--   
--   
--   >>> show <$> Left 17
--   Left 17
--   
--   
--   
--   >>> show <$> Right 17
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> (*2) <$> [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> even <$> (2,2)
--   (2,True)
--   
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>

-- | The parser satisfy f succeeds for any character for which the
--   supplied function f returns True. Returns the
--   character that is actually parsed.
satisfy :: Input inp => (Char -> Bool) -> MkParser inp Char

-- | char c parses a single character c. Returns the
--   parsed character.
char :: Input inp => Char -> MkParser inp Char

-- | string s parses a sequence of characters given by s.
--   Returns the parsed string
string :: Input inp => String -> MkParser inp String

-- | choice ps tries to apply the parsers in the list ps
--   in order, until one of them succeeds. Returns the value of the
--   succeeding parser.
choice :: [MkParser inp a] -> MkParser inp a

-- | option x p tries to apply parser p. If p
--   fails without consuming input, it returns the value x,
--   otherwise the value returned by p.
option :: a -> MkParser inp a -> MkParser inp a

-- | skipMany p applies the parser p zero or more
--   times, skipping its result.
skipMany :: MkParser inp a -> MkParser inp ()

-- | sepBy1 p sep parses one or more occurrences of
--   p, separated by sep. Returns a list of values
--   returned by p.
sepBy1 :: MkParser inp a -> MkParser inp b -> MkParser inp [a]

-- | manyTill p end applies parser p zero or more
--   times until parser end succeeds. Returns the list of values
--   returned by p.
manyTill :: MkParser inp a -> MkParser inp b -> MkParser inp [a]

-- | The parser try p behaves like parser p, except that it pretends that
--   it hasn't consumed any input when an error occurs.
try :: MkParser inp a -> MkParser inp a
data MkParser inp a
P :: (inp -> (Maybe a, inp)) -> MkParser inp a

-- | Getting the internal parser.
[runParser] :: MkParser inp a -> inp -> (Maybe a, inp)

-- | Parses a white space character (any character which satisfies
--   isSpace) Returns the parsed character.
space :: Input inp => MkParser inp Char

-- | The class for parser input.
class Eq inp => Input inp

-- | The head function for input
car :: Input inp => inp -> Char

-- | The tail function for input
cdr :: Input inp => inp -> inp

-- | The end of input
nil :: Input inp => inp

-- | The function to check the end of input
isNil :: Input inp => inp -> Bool

-- | Run a parser.
parse :: Input inp => MkParser inp a -> inp -> Maybe a

-- | This parser succeeds for any character. Returns the parsed character.
anyChar :: Input inp => MkParser inp Char

-- | oneOf cs succeeds if the current character is in the supplied
--   list of characters cs. Returns the parsed character.
oneOf :: Input inp => String -> MkParser inp Char

-- | As the dual of oneOf, noneOf cs succeeds if the
--   current character not in the supplied list of characters
--   cs. Returns the parsed character.
noneOf :: Input inp => String -> MkParser inp Char

-- | Parses a letter or digit (a character between '0' and '9'). Returns
--   the parsed character.
alphaNum :: Input inp => MkParser inp Char

-- | Parses a digit. Returns the parsed character.
digit :: Input inp => MkParser inp Char

-- | Parses a hexadecimal digit (a digit or a letter between 'a' and 'f' or
--   'A' and 'F'). Returns the parsed character.
hexDigit :: Input inp => MkParser inp Char

-- | skipSome p applies the parser p one or more
--   times, skipping its result.
skipSome :: MkParser inp a -> MkParser inp ()

-- | Simple Applicative parser whose input is strict
--   ByteString. The usage is the same as parsec.
--   
--   Parsec 3 provides features which Parsec 2 does not provide:
--   
--   
--   
- Applicative style
--   
- ByteString as input
--   
--   
--   But Haskell Platform includes Parsec 2, not Parsec 3. Installing
--   Parsec 3 to Haskell Platform environment makes it mess. So, this
--   library was implemented.
module Text.Appar.ByteString

-- | Parser synonym for strict ByteString.
type Parser = MkParser ByteString

-- | Sequential application.
--   
--   A few functors support an implementation of <*> that is
--   more efficient than the default one.
--   
--   
Example
--   
--   Used in combination with (<$>),
--   (<*>) can be used to build a record.
--   
--   
--   >>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}
--   
--   
--   
--   >>> produceFoo :: Applicative f => f Foo
--   
--   >>> produceBar :: Applicative f => f Bar
--   
--   >>> produceBaz :: Applicative f => f Baz
--   
--   
--   
--   >>> mkState :: Applicative f => f MyState
--   
--   >>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz
--   
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
infixl 4 <*>

-- | Lift a value into the Structure.
--   
--   
Examples
--   
--   
--   >>> pure 1 :: Maybe Int
--   Just 1
--   
--   
--   
--   >>> pure 'z' :: [Char]
--   "z"
--   
--   
--   
--   >>> pure (pure ":D") :: Maybe [String]
--   Just [":D"]
--   
pure :: Applicative f => a -> f a

-- | Sequence actions, discarding the value of the first argument.
--   
--   
Examples
--   
--   If used in conjunction with the Applicative instance for Maybe,
--   you can chain Maybe computations, with a possible "early return" in
--   case of Nothing.
--   
--   
--   >>> Just 2 *> Just 3
--   Just 3
--   
--   
--   
--   >>> Nothing *> Just 3
--   Nothing
--   
--   
--   Of course a more interesting use case would be to have effectful
--   computations instead of just returning pure values.
--   
--   
--   >>> import Data.Char
--   
--   >>> import GHC.Internal.Text.ParserCombinators.ReadP
--   
--   >>> let p = string "my name is " *> munch1 isAlpha <* eof
--   
--   >>> readP_to_S p "my name is Simon"
--   [("Simon","")]
--   
(*>) :: Applicative f => f a -> f b -> f b
infixl 4 *>

-- | Sequence actions, discarding the value of the second argument.
(<*) :: Applicative f => f a -> f b -> f a
infixl 4 <*

-- | An associative binary operation
(<|>) :: Alternative f => f a -> f a -> f a
infixl 3 <|>

-- | One or more.
--   
--   
Examples
--   
--   
--   >>> some (putStr "la")
--   lalalalalalalalala... * goes on forever *
--   
--   
--   
--   >>> some Nothing
--   nothing
--   
--   
--   
--   >>> take 5 <$> some (Just 1)
--   * hangs forever *
--   
--   
--   Note that this function can be used with Parsers based on
--   Applicatives. In that case some parser will attempt to parse
--   parser one or more times until it fails.
some :: Alternative f => f a -> f [a]

-- | Zero or more.
--   
--   
Examples
--   
--   
--   >>> many (putStr "la")
--   lalalalalalalalala... * goes on forever *
--   
--   
--   
--   >>> many Nothing
--   Just []
--   
--   
--   
--   >>> take 5 <$> many (Just 1)
--   * hangs forever *
--   
--   
--   Note that this function can be used with Parsers based on
--   Applicatives. In that case many parser will attempt to parse
--   parser zero or more times until it fails.
many :: Alternative f => f a -> f [a]

-- | Replace all locations in the input with the same value. The default
--   definition is fmap . const, but this may be
--   overridden with a more efficient version.
--   
--   
Examples
--   
--   Perform a computation with Maybe and replace the result with a
--   constant value if it is Just:
--   
--   
--   >>> 'a' <$ Just 2
--   Just 'a'
--   
--   >>> 'a' <$ Nothing
--   Nothing
--   
(<$) :: Functor f => a -> f b -> f a
infixl 4 <$

-- | A variant of <*> with the types of the arguments
--   reversed. It differs from flip (<*>) in
--   that the effects are resolved in the order the arguments are
--   presented.
--   
--   
Examples
--   
--   
--   >>> (<**>) (print 1) (id <$ print 2)
--   1
--   2
--   
--   
--   
--   >>> flip (<*>) (print 1) (id <$ print 2)
--   2
--   1
--   
--   
--   
--   >>> ZipList [4, 5, 6] <**> ZipList [(+1), (*2), (/3)]
--   ZipList {getZipList = [5.0,10.0,2.0]}
--   
(<**>) :: Applicative f => f a -> f (a -> b) -> f b
infixl 4 <**>

-- | An infix synonym for fmap.
--   
--   The name of this operator is an allusion to $. Note the
--   similarities between their types:
--   
--   
--    ($)  ::              (a -> b) ->   a ->   b
--   (<$>) :: Functor f => (a -> b) -> f a -> f b
--   
--   
--   Whereas $ is function application, <$> is function
--   application lifted over a Functor.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe
--   String using show:
--   
--   
--   >>> show <$> Nothing
--   Nothing
--   
--   
--   
--   >>> show <$> Just 3
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an
--   Either Int String using show:
--   
--   
--   >>> show <$> Left 17
--   Left 17
--   
--   
--   
--   >>> show <$> Right 17
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> (*2) <$> [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> even <$> (2,2)
--   (2,True)
--   
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>

-- | The parser satisfy f succeeds for any character for which the
--   supplied function f returns True. Returns the
--   character that is actually parsed.
satisfy :: Input inp => (Char -> Bool) -> MkParser inp Char

-- | char c parses a single character c. Returns the
--   parsed character.
char :: Input inp => Char -> MkParser inp Char

-- | string s parses a sequence of characters given by s.
--   Returns the parsed string
string :: Input inp => String -> MkParser inp String

-- | choice ps tries to apply the parsers in the list ps
--   in order, until one of them succeeds. Returns the value of the
--   succeeding parser.
choice :: [MkParser inp a] -> MkParser inp a

-- | option x p tries to apply parser p. If p
--   fails without consuming input, it returns the value x,
--   otherwise the value returned by p.
option :: a -> MkParser inp a -> MkParser inp a

-- | skipMany p applies the parser p zero or more
--   times, skipping its result.
skipMany :: MkParser inp a -> MkParser inp ()

-- | sepBy1 p sep parses one or more occurrences of
--   p, separated by sep. Returns a list of values
--   returned by p.
sepBy1 :: MkParser inp a -> MkParser inp b -> MkParser inp [a]

-- | manyTill p end applies parser p zero or more
--   times until parser end succeeds. Returns the list of values
--   returned by p.
manyTill :: MkParser inp a -> MkParser inp b -> MkParser inp [a]

-- | The parser try p behaves like parser p, except that it pretends that
--   it hasn't consumed any input when an error occurs.
try :: MkParser inp a -> MkParser inp a
data MkParser inp a
P :: (inp -> (Maybe a, inp)) -> MkParser inp a

-- | Getting the internal parser.
[runParser] :: MkParser inp a -> inp -> (Maybe a, inp)

-- | Parses a white space character (any character which satisfies
--   isSpace) Returns the parsed character.
space :: Input inp => MkParser inp Char

-- | The class for parser input.
class Eq inp => Input inp

-- | The head function for input
car :: Input inp => inp -> Char

-- | The tail function for input
cdr :: Input inp => inp -> inp

-- | The end of input
nil :: Input inp => inp

-- | The function to check the end of input
isNil :: Input inp => inp -> Bool

-- | Run a parser.
parse :: Input inp => MkParser inp a -> inp -> Maybe a

-- | This parser succeeds for any character. Returns the parsed character.
anyChar :: Input inp => MkParser inp Char

-- | oneOf cs succeeds if the current character is in the supplied
--   list of characters cs. Returns the parsed character.
oneOf :: Input inp => String -> MkParser inp Char

-- | As the dual of oneOf, noneOf cs succeeds if the
--   current character not in the supplied list of characters
--   cs. Returns the parsed character.
noneOf :: Input inp => String -> MkParser inp Char

-- | Parses a letter or digit (a character between '0' and '9'). Returns
--   the parsed character.
alphaNum :: Input inp => MkParser inp Char

-- | Parses a digit. Returns the parsed character.
digit :: Input inp => MkParser inp Char

-- | Parses a hexadecimal digit (a digit or a letter between 'a' and 'f' or
--   'A' and 'F'). Returns the parsed character.
hexDigit :: Input inp => MkParser inp Char

-- | skipSome p applies the parser p one or more
--   times, skipping its result.
skipSome :: MkParser inp a -> MkParser inp ()

-- | Simple Applicative parser whose input is String. The
--   usage is the same as parsec.
--   
--   Parsec 3 provides features which Parsec 2 does not provide:
--   
--   
--   
- Applicative style
--   
- ByteString as input
--   
--   
--   But Haskell Platform includes Parsec 2, not Parsec 3. Installing
--   Parsec 3 to Haskell Platform environment makes it mess. So, this
--   library was implemented.
module Text.Appar.String

-- | Parser synonym for String.
type Parser = MkParser String

-- | Sequential application.
--   
--   A few functors support an implementation of <*> that is
--   more efficient than the default one.
--   
--   
Example
--   
--   Used in combination with (<$>),
--   (<*>) can be used to build a record.
--   
--   
--   >>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}
--   
--   
--   
--   >>> produceFoo :: Applicative f => f Foo
--   
--   >>> produceBar :: Applicative f => f Bar
--   
--   >>> produceBaz :: Applicative f => f Baz
--   
--   
--   
--   >>> mkState :: Applicative f => f MyState
--   
--   >>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz
--   
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
infixl 4 <*>

-- | Lift a value into the Structure.
--   
--   
Examples
--   
--   
--   >>> pure 1 :: Maybe Int
--   Just 1
--   
--   
--   
--   >>> pure 'z' :: [Char]
--   "z"
--   
--   
--   
--   >>> pure (pure ":D") :: Maybe [String]
--   Just [":D"]
--   
pure :: Applicative f => a -> f a

-- | Sequence actions, discarding the value of the first argument.
--   
--   
Examples
--   
--   If used in conjunction with the Applicative instance for Maybe,
--   you can chain Maybe computations, with a possible "early return" in
--   case of Nothing.
--   
--   
--   >>> Just 2 *> Just 3
--   Just 3
--   
--   
--   
--   >>> Nothing *> Just 3
--   Nothing
--   
--   
--   Of course a more interesting use case would be to have effectful
--   computations instead of just returning pure values.
--   
--   
--   >>> import Data.Char
--   
--   >>> import GHC.Internal.Text.ParserCombinators.ReadP
--   
--   >>> let p = string "my name is " *> munch1 isAlpha <* eof
--   
--   >>> readP_to_S p "my name is Simon"
--   [("Simon","")]
--   
(*>) :: Applicative f => f a -> f b -> f b
infixl 4 *>

-- | Sequence actions, discarding the value of the second argument.
(<*) :: Applicative f => f a -> f b -> f a
infixl 4 <*

-- | An associative binary operation
(<|>) :: Alternative f => f a -> f a -> f a
infixl 3 <|>

-- | One or more.
--   
--   
Examples
--   
--   
--   >>> some (putStr "la")
--   lalalalalalalalala... * goes on forever *
--   
--   
--   
--   >>> some Nothing
--   nothing
--   
--   
--   
--   >>> take 5 <$> some (Just 1)
--   * hangs forever *
--   
--   
--   Note that this function can be used with Parsers based on
--   Applicatives. In that case some parser will attempt to parse
--   parser one or more times until it fails.
some :: Alternative f => f a -> f [a]

-- | Zero or more.
--   
--   
Examples
--   
--   
--   >>> many (putStr "la")
--   lalalalalalalalala... * goes on forever *
--   
--   
--   
--   >>> many Nothing
--   Just []
--   
--   
--   
--   >>> take 5 <$> many (Just 1)
--   * hangs forever *
--   
--   
--   Note that this function can be used with Parsers based on
--   Applicatives. In that case many parser will attempt to parse
--   parser zero or more times until it fails.
many :: Alternative f => f a -> f [a]

-- | Replace all locations in the input with the same value. The default
--   definition is fmap . const, but this may be
--   overridden with a more efficient version.
--   
--   
Examples
--   
--   Perform a computation with Maybe and replace the result with a
--   constant value if it is Just:
--   
--   
--   >>> 'a' <$ Just 2
--   Just 'a'
--   
--   >>> 'a' <$ Nothing
--   Nothing
--   
(<$) :: Functor f => a -> f b -> f a
infixl 4 <$

-- | A variant of <*> with the types of the arguments
--   reversed. It differs from flip (<*>) in
--   that the effects are resolved in the order the arguments are
--   presented.
--   
--   
Examples
--   
--   
--   >>> (<**>) (print 1) (id <$ print 2)
--   1
--   2
--   
--   
--   
--   >>> flip (<*>) (print 1) (id <$ print 2)
--   2
--   1
--   
--   
--   
--   >>> ZipList [4, 5, 6] <**> ZipList [(+1), (*2), (/3)]
--   ZipList {getZipList = [5.0,10.0,2.0]}
--   
(<**>) :: Applicative f => f a -> f (a -> b) -> f b
infixl 4 <**>

-- | An infix synonym for fmap.
--   
--   The name of this operator is an allusion to $. Note the
--   similarities between their types:
--   
--   
--    ($)  ::              (a -> b) ->   a ->   b
--   (<$>) :: Functor f => (a -> b) -> f a -> f b
--   
--   
--   Whereas $ is function application, <$> is function
--   application lifted over a Functor.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe
--   String using show:
--   
--   
--   >>> show <$> Nothing
--   Nothing
--   
--   
--   
--   >>> show <$> Just 3
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an
--   Either Int String using show:
--   
--   
--   >>> show <$> Left 17
--   Left 17
--   
--   
--   
--   >>> show <$> Right 17
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> (*2) <$> [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> even <$> (2,2)
--   (2,True)
--   
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>

-- | The parser satisfy f succeeds for any character for which the
--   supplied function f returns True. Returns the
--   character that is actually parsed.
satisfy :: Input inp => (Char -> Bool) -> MkParser inp Char

-- | char c parses a single character c. Returns the
--   parsed character.
char :: Input inp => Char -> MkParser inp Char

-- | string s parses a sequence of characters given by s.
--   Returns the parsed string
string :: Input inp => String -> MkParser inp String

-- | choice ps tries to apply the parsers in the list ps
--   in order, until one of them succeeds. Returns the value of the
--   succeeding parser.
choice :: [MkParser inp a] -> MkParser inp a

-- | option x p tries to apply parser p. If p
--   fails without consuming input, it returns the value x,
--   otherwise the value returned by p.
option :: a -> MkParser inp a -> MkParser inp a

-- | skipMany p applies the parser p zero or more
--   times, skipping its result.
skipMany :: MkParser inp a -> MkParser inp ()

-- | sepBy1 p sep parses one or more occurrences of
--   p, separated by sep. Returns a list of values
--   returned by p.
sepBy1 :: MkParser inp a -> MkParser inp b -> MkParser inp [a]

-- | manyTill p end applies parser p zero or more
--   times until parser end succeeds. Returns the list of values
--   returned by p.
manyTill :: MkParser inp a -> MkParser inp b -> MkParser inp [a]

-- | The parser try p behaves like parser p, except that it pretends that
--   it hasn't consumed any input when an error occurs.
try :: MkParser inp a -> MkParser inp a
data MkParser inp a
P :: (inp -> (Maybe a, inp)) -> MkParser inp a

-- | Getting the internal parser.
[runParser] :: MkParser inp a -> inp -> (Maybe a, inp)

-- | Parses a white space character (any character which satisfies
--   isSpace) Returns the parsed character.
space :: Input inp => MkParser inp Char

-- | The class for parser input.
class Eq inp => Input inp

-- | The head function for input
car :: Input inp => inp -> Char

-- | The tail function for input
cdr :: Input inp => inp -> inp

-- | The end of input
nil :: Input inp => inp

-- | The function to check the end of input
isNil :: Input inp => inp -> Bool

-- | Run a parser.
parse :: Input inp => MkParser inp a -> inp -> Maybe a

-- | This parser succeeds for any character. Returns the parsed character.
anyChar :: Input inp => MkParser inp Char

-- | oneOf cs succeeds if the current character is in the supplied
--   list of characters cs. Returns the parsed character.
oneOf :: Input inp => String -> MkParser inp Char

-- | As the dual of oneOf, noneOf cs succeeds if the
--   current character not in the supplied list of characters
--   cs. Returns the parsed character.
noneOf :: Input inp => String -> MkParser inp Char

-- | Parses a letter or digit (a character between '0' and '9'). Returns
--   the parsed character.
alphaNum :: Input inp => MkParser inp Char

-- | Parses a digit. Returns the parsed character.
digit :: Input inp => MkParser inp Char

-- | Parses a hexadecimal digit (a digit or a letter between 'a' and 'f' or
--   'A' and 'F'). Returns the parsed character.
hexDigit :: Input inp => MkParser inp Char

-- | skipSome p applies the parser p one or more
--   times, skipping its result.
skipSome :: MkParser inp a -> MkParser inp ()
