aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Internal.hs
blob: 6a880ee6a8c7c64dfc67a3d19515ee10fa4ff783 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{-|
Module      : VeriFuzz.Internal
Description : Shared high level code used in the other modules internally.
Copyright   : (c) 2018-2019, Yann Herklotz Grave
License     : BSD-3
Maintainer  : ymherklotz [at] gmail [dot] com
Stability   : experimental
Portability : POSIX

Shared high level code used in the other modules internally.
-}

module VeriFuzz.Internal
  ( -- * Useful functions
    safe
    -- * Module Specific Internals
  , module VeriFuzz.Internal.Circuit
  , module VeriFuzz.Internal.Simulator
  , module VeriFuzz.Internal.AST
  ) where

import           VeriFuzz.Internal.AST
import           VeriFuzz.Internal.Circuit
import           VeriFuzz.Internal.Simulator

-- | 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