aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Internal.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2019-06-29 20:21:43 +0100
committerYann Herklotz <git@yannherklotz.com>2019-06-29 20:21:43 +0100
commitbb697f8bc7b593e5aabb43505f686e6503b7726f (patch)
treee25f874fa5b68224337b016e1d17ef45204e45c0 /src/VeriFuzz/Internal.hs
parent8734d40f4842065ce5a579eb0cc77171bbd436b0 (diff)
downloadverismith-bb697f8bc7b593e5aabb43505f686e6503b7726f.tar.gz
verismith-bb697f8bc7b593e5aabb43505f686e6503b7726f.zip
Fix pedantic warnings
Diffstat (limited to 'src/VeriFuzz/Internal.hs')
-rw-r--r--src/VeriFuzz/Internal.hs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/VeriFuzz/Internal.hs b/src/VeriFuzz/Internal.hs
index 22efa92..fd9d409 100644
--- a/src/VeriFuzz/Internal.hs
+++ b/src/VeriFuzz/Internal.hs
@@ -14,13 +14,22 @@ module VeriFuzz.Internal
( -- * Useful functions
safe
, showT
+ , showBS
, comma
, commaNL
)
where
-import Data.Text (Text)
-import qualified Data.Text as T
+import Data.ByteString (ByteString)
+import Data.ByteString.Builder (byteStringHex, toLazyByteString)
+import qualified Data.ByteString.Lazy as L
+import Data.Text (Text)
+import qualified Data.Text as T
+import Data.Text.Encoding (decodeUtf8)
+
+-- | Function to show a bytestring in a hex format.
+showBS :: ByteString -> Text
+showBS = decodeUtf8 . L.toStrict . toLazyByteString . byteStringHex
-- | Converts unsafe list functions in the Prelude to a safe version.
safe :: ([a] -> b) -> [a] -> Maybe b