--------------------------------------------------------------------------------
-- |
-- Module : Database.EventStore.Internal.Utils
-- Copyright : (C) 2016 Yorick Laupa
-- License : (see the file LICENSE)
--
-- Maintainer : Yorick Laupa <yo.eight@gmail.com>
-- Stability : provisional
-- Portability : non-portable
--
--------------------------------------------------------------------------------
module Database.EventStore.Internal.Utils (prettyWord8) where

--------------------------------------------------------------------------------
import Prelude (String)
import Numeric

--------------------------------------------------------------------------------
import Database.EventStore.Internal.Prelude

--------------------------------------------------------------------------------
prettyWord8 :: Word8 -> String
prettyWord8 :: Word8 -> String
prettyWord8 Word8
w = String
"0x" forall a. Semigroup a => a -> a -> a
<> String -> String
padding (forall a. (Integral a, Show a) => a -> String -> String
showHex Word8
w String
"")

--------------------------------------------------------------------------------
padding :: String -> String
padding :: String -> String
padding [Char
x] = [Char
'0',Char
x]
padding String
xs  = String
xs