Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class ToBytes a where
- data Msg
- data Builder
- data Element
- 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
- builderSize :: Builder -> Int
- builderBytes :: Builder -> Builder
- render :: ([Element] -> Builder) -> (Msg -> Msg) -> ByteString
- renderDefault :: ByteString -> [Element] -> Builder
- renderNetstr :: [Element] -> Builder
Documentation
class ToBytes a where Source #
Convert some value to a Builder
.
Instances
ToBytes Bool Source # | |
ToBytes Char Source # | |
ToBytes Double Source # | |
ToBytes Float Source # | |
ToBytes Int Source # | |
ToBytes Int8 Source # | |
ToBytes Int16 Source # | |
ToBytes Int32 Source # | |
ToBytes Int64 Source # | |
ToBytes Integer Source # | |
ToBytes Word Source # | |
ToBytes Word8 Source # | |
ToBytes Word16 Source # | |
ToBytes Word32 Source # | |
ToBytes Word64 Source # | |
ToBytes ByteString Source # | |
Defined in System.Logger.Message bytes :: ByteString -> Builder Source # | |
ToBytes ByteString Source # | |
Defined in System.Logger.Message bytes :: ByteString -> Builder Source # | |
ToBytes Text Source # | |
ToBytes Text Source # | |
ToBytes Builder Source # | |
ToBytes [Char] Source # | |
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 #
builderSize :: Builder -> Int Source #
builderBytes :: Builder -> Builder Source #
render :: ([Element] -> Builder) -> (Msg -> Msg) -> ByteString Source #
Construct elements, call a renderer, and run the whole builder
into a ByteString
.
renderDefault :: ByteString -> [Element] -> Builder Source #
Simple Renderer
with '=' between field names and values and a custom
separator.