diff options
author | Yann Herklotz <git@yannherklotz.com> | 2020-05-13 01:18:38 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2020-05-13 01:19:01 +0100 |
commit | 04b70e9a1dc919d5b6570b0db781603c43baefc7 (patch) | |
tree | 9be8adf9c93e430dcb1c0c6d3b39b0aa33a2ea15 /src/Verismith/Internal.hs | |
parent | d50a0b5b57aae1c7558fa77c362ae2e36038b63c (diff) | |
parent | 501cac8b2eda9e68c200231bdabca17ac48264d7 (diff) | |
download | verismith-04b70e9a1dc919d5b6570b0db781603c43baefc7.tar.gz verismith-04b70e9a1dc919d5b6570b0db781603c43baefc7.zip |
Better reducer and formatting (#76)
Diffstat (limited to 'src/Verismith/Internal.hs')
-rw-r--r-- | src/Verismith/Internal.hs | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/src/Verismith/Internal.hs b/src/Verismith/Internal.hs index 02f73ce..77c5525 100644 --- a/src/Verismith/Internal.hs +++ b/src/Verismith/Internal.hs @@ -1,31 +1,29 @@ -{-| -Module : Verismith.Internal -Description : Shared high level code used in the other modules internally. -Copyright : (c) 2018-2019, Yann Herklotz -License : GPL-3 -Maintainer : yann [at] yannherklotz [dot] com -Stability : experimental -Portability : POSIX - -Shared high level code used in the other modules internally. --} - +-- | +-- Module : Verismith.Internal +-- Description : Shared high level code used in the other modules internally. +-- Copyright : (c) 2018-2019, Yann Herklotz +-- License : GPL-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 - ) + ( -- * 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) +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 @@ -34,7 +32,7 @@ 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 +safe f l = Just $ f l -- | Show function for 'Text' showT :: (Show a) => a -> Text |