aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Internal.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2019-09-04 20:15:51 +1000
committerYann Herklotz <git@yannherklotz.com>2019-09-04 20:15:51 +1000
commita2b01b92612a098673ff03890e6e8aef4ceb28ea (patch)
tree15cafe6ba47981938552a4b342a56795251aadc5 /src/VeriFuzz/Internal.hs
parentcccb665ebac6e916c4f961eacbe11a9af7d7ceb3 (diff)
downloadverismith-a2b01b92612a098673ff03890e6e8aef4ceb28ea.tar.gz
verismith-a2b01b92612a098673ff03890e6e8aef4ceb28ea.zip
Renaming to VeriSmith
Diffstat (limited to 'src/VeriFuzz/Internal.hs')
-rw-r--r--src/VeriFuzz/Internal.hs49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/VeriFuzz/Internal.hs b/src/VeriFuzz/Internal.hs
deleted file mode 100644
index 86cb1f7..0000000
--- a/src/VeriFuzz/Internal.hs
+++ /dev/null
@@ -1,49 +0,0 @@
-{-|
-Module : VeriSmith.Internal
-Description : Shared high level code used in the other modules internally.
-Copyright : (c) 2018-2019, Yann Herklotz
-License : BSD-3
-Maintainer : yann [at] yannherklotz [dot] com
-Stability : experimental
-Portability : POSIX
-
-Shared high level code used in the other modules internally.
--}
-
-module VeriSmith.Internal
- ( -- * Useful functions
- safe
- , showT
- , showBS
- , comma
- , commaNL
- )
-where
-
-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
-safe _ [] = Nothing
-safe f l = Just $ f l
-
--- | Show function for 'Text'
-showT :: (Show a) => a -> Text
-showT = T.pack . show
-
--- | Inserts commas between '[Text]' and except the last one.
-comma :: [Text] -> Text
-comma = T.intercalate ", "
-
--- | Inserts commas and newlines between '[Text]' and except the last one.
-commaNL :: [Text] -> Text
-commaNL = T.intercalate ",\n"