Safe Haskell | None |
---|---|
Language | Haskell2010 |
Text generator. The PutM
specialization for text output.
Synopsis
- type PutM s i o m a = PutS s (ConduitT i o m) a
- type TextGen = forall s i m. (DefaultTextGenState s, Monad m) => PutM s i Text m ()
- runTextGen :: PutM VoidEncodingState i o m () -> ConduitT i o m ()
- genString :: Text -> TextGen
- genLazyString :: Text -> TextGen
- genShow :: Show a => a -> TextGen
- genDigit :: Integral a => a -> TextGen
- genHexDigit :: Integral a => Bool -> a -> TextGen
- genHexByte :: Bool -> Word8 -> TextGen
- genEnum :: (Eq a, Ord a, Enum a, Bounded a, Show a) => Int -> a -> TextGen
Documentation
type PutM s i o m a = PutS s (ConduitT i o m) a Source #
A ConduitT
with wrappers supposed to a binary or text serialization.
type TextGen = forall s i m. (DefaultTextGenState s, Monad m) => PutM s i Text m () Source #
The shortening of PutM
for the most common use case of text serialization.
runTextGen :: PutM VoidEncodingState i o m () -> ConduitT i o m () Source #
genLazyString :: Text -> TextGen Source #
Output a string.
genEnum :: (Eq a, Ord a, Enum a, Bounded a, Show a) => Int -> a -> TextGen Source #
Output an enum value.
For example, for
data CharKind = CharKindWhitespace | CharKindOrdinar deriving (Eq, Ord, Enum, Bounded, Show)
the following statement is true:
runConduitPure $ runTextGen (genEnum 8 CharKindWhitespace) .| sinkLazy = "Whitespace"