Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Parser s a = Parser {}
- newtype Option a where
- mapOption :: (a -> b) -> Option a -> Option b
- setOption :: b -> Option a -> Option b
- type Result s a = (# Option a, Addr#, State# s #)
- pattern OK :: a -> Addr# -> State# s -> Result s a
- pattern Fail :: Addr# -> State# s -> Result s a
- mapResult :: (a -> b) -> Result s a -> Result s b
- setResult :: b -> Result s a -> Result s b
- try :: Parser s a -> Parser s a
- lit :: Addr# -> Parser s ByteString
- litN :: Addr# -> CSize -> Parser s ByteString
- word8 :: Word8 -> Parser s Word8
- data Base s = Base {}
- bytes :: forall s. KnownBase s => ByteString
- start :: forall s. KnownBase s => Addr#
- end :: forall s. KnownBase s => Addr#
- class KnownBase (s :: Type) where
- reflectBase :: Base s
- parse :: (forall s. KnownBase s => Parser s a) -> ByteString -> Either Location a
Parser
Instances
Monad (Parser s) Source # | |
Functor (Parser s) Source # | |
Applicative (Parser s) Source # | |
Alternative (Parser s) Source # | |
MonadPlus (Parser s) Source # | |
PrimMonad (Parser s) Source # | |
a ~ ByteString => IsString (Parser s a) Source # | |
Defined in Text.Parsnip.Internal.Parser fromString :: String -> Parser s a # | |
type PrimState (Parser s) Source # | |
Defined in Text.Parsnip.Internal.Parser type PrimState (Parser s) = s |
Unsafe literals
lit :: Addr# -> Parser s ByteString Source #
Super unsafe. Fabricates a bytestring that directly reference constant memory.
Usage:
hello = lit "hello"#
litN :: Addr# -> CSize -> Parser s ByteString Source #
super-duper unsafe. Fabricates bytestrings that directly reference constant memory
Guts
Base | |
|
bytes :: forall s. KnownBase s => ByteString Source #