Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class ToBytes a where
- data Msg
- data Builder
- msg :: ToBytes a => a -> Msg -> Msg
- field :: ToBytes a => ByteString -> a -> Msg -> Msg
- (.=) :: ToBytes a => ByteString -> a -> Msg -> Msg
- (+++) :: (ToBytes a, ToBytes b) => a -> b -> Builder
- (~~) :: (b -> c) -> (a -> b) -> a -> c
- val :: ByteString -> Builder
- eval :: Builder -> ByteString
- render :: ByteString -> Bool -> (Msg -> Msg) -> ByteString
Documentation
class ToBytes a where Source #
Convert some value to a Builder
.
field :: ToBytes a => ByteString -> a -> Msg -> Msg Source #
Render some field, i.e. a key-value pair delimited by "=".
(+++) :: (ToBytes a, ToBytes b) => a -> b -> Builder infixr 6 Source #
Concatenate two ToBytes
values.
val :: ByteString -> Builder Source #
Type restriction. Useful to disambiguate string literals when
using OverloadedStrings
pragma.
eval :: Builder -> ByteString Source #
render :: ByteString -> Bool -> (Msg -> Msg) -> ByteString Source #
Intersperse parts of the log message with the given delimiter and
render the whole builder into a ByteString
.
If the second parameter is set to True
, netstrings encoding is used for
the message elements. Cf. http://cr.yp.to/proto/netstrings.txt for
details.