| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Text.Pup.Class.Char
Description
Format descriptors specialised to the token type Char. See also
Text.Megaparsec.Char.
Synopsis
- digit :: (Stacked m, Monad m, Tokens Char chunk m) => m (Int -> r) r Int
- digitChar :: Tokens Char chunk m => m (Char -> r) r Char
- nat :: (Stacked m, Alternative m, Tokens Char chunk m) => m (Int -> r) r Int
- char :: Tokens Char chunk m => Char -> m r r Char
- anyChar :: Tokens Char chunk m => m (Char -> r) r Char
- read :: (Applicative m, Stacked m, Read a, Show a) => m (a -> r) (String -> r) (String -> a)
- readM :: (MonadFail m, Stacked m, Read a, Show a) => String -> m (a -> r) (String -> r) a
Numbers
nat :: (Stacked m, Alternative m, Tokens Char chunk m) => m (Int -> r) r Int Source #
A (maximal) sequence of decimal digits interpreted as a natural number
Individual characters
Read and show
read :: (Applicative m, Stacked m, Read a, Show a) => m (a -> r) (String -> r) (String -> a) Source #
A total lead based using read and show for the respective directions.
It is the responsibility of the parser to ensure that the input is the domain
of read (the printer, on the other hand always succeeds). Otherwise
the read descriptor will fail with error.
For a format descriptor capable of failing with a parse error, see readM.