diff options
Diffstat (limited to 'src/VeriFuzz/Internal.hs')
-rw-r--r-- | src/VeriFuzz/Internal.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/VeriFuzz/Internal.hs b/src/VeriFuzz/Internal.hs index 6a880ee..3c339b5 100644 --- a/src/VeriFuzz/Internal.hs +++ b/src/VeriFuzz/Internal.hs @@ -13,12 +13,16 @@ Shared high level code used in the other modules internally. module VeriFuzz.Internal ( -- * Useful functions safe + , showT + , comma -- * Module Specific Internals , module VeriFuzz.Internal.Circuit , module VeriFuzz.Internal.Simulator , module VeriFuzz.Internal.AST ) where +import Data.Text (Text) +import qualified Data.Text as T import VeriFuzz.Internal.AST import VeriFuzz.Internal.Circuit import VeriFuzz.Internal.Simulator @@ -27,3 +31,11 @@ import VeriFuzz.Internal.Simulator 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 ", " |