From 73776fa9bf6b82c09c6c557238d89239ac6f7839 Mon Sep 17 00:00:00 2001 From: Toralf Wittner Date: Wed, 19 Mar 2014 17:39:43 +0100 Subject: [PATCH] Add more `ToBytes` instances. --- src/System/Logger/Message.hs | 6 ++++++ tinylog.cabal | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/System/Logger/Message.hs b/src/System/Logger/Message.hs index fae0adc..6d9a43c 100644 --- a/src/System/Logger/Message.hs +++ b/src/System/Logger/Message.hs @@ -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 diff --git a/tinylog.cabal b/tinylog.cabal index b71a467..1b797e9 100644 --- a/tinylog.cabal +++ b/tinylog.cabal @@ -1,5 +1,5 @@ name: tinylog -version: 0.6 +version: 0.6.1 synopsis: Simplistic logging using fast-logger. author: Toralf Wittner maintainer: Toralf Wittner -- GitLab