Commit 73776fa9 authored by Toralf Wittner's avatar Toralf Wittner
Browse files

Add more `ToBytes` instances.

parent 4fe99de4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -49,10 +49,16 @@ instance ToBytes Word8 where bytes = B.word8Dec
instance ToBytes Word16       where bytes = B.word16Dec
instance ToBytes Word32       where bytes = B.word32Dec
instance ToBytes Word64       where bytes = B.word64Dec
instance ToBytes Float        where bytes = B.floatDec
instance ToBytes Double       where bytes = B.doubleDec
instance ToBytes Text         where bytes = B.byteString . encodeUtf8
instance ToBytes T.Text       where bytes = B.lazyByteString . T.encodeUtf8
instance ToBytes [Char]       where bytes = B.stringUtf8

instance ToBytes Bool where
    bytes True  = val "True"
    bytes False = val "False"

newtype Msg = Msg { builders :: [Builder] }

msg :: ToBytes a => a -> Msg -> Msg
+1 −1
Original line number Diff line number Diff line
name:                 tinylog
version:              0.6
version:              0.6.1
synopsis:             Simplistic logging using fast-logger.
author:               Toralf Wittner
maintainer:           Toralf Wittner <tw@dtex.org>