{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
module Clash.Verification.Internal
( AssertionResult(..)
, Property(..)
, Assertion(..)
, RenderAs(..)
, IsTemporal(..)
, AssertionValue(toAssertionValue)
, Assertion'(..)
, Property'(..)
, toTemporal
, isTemporal
, assertion
)
where
import Data.Text (Text)
import Clash.Annotations.BitRepresentation
(ConstrRepr(..), DataReprAnn(..), liftQ)
import Clash.Signal.Internal (Domain, Signal)
data RenderAs
= PSL
| SVA
| AutoRenderAs
| YosysFormal
deriving (Int -> RenderAs -> ShowS
[RenderAs] -> ShowS
RenderAs -> String
(Int -> RenderAs -> ShowS)
-> (RenderAs -> String) -> ([RenderAs] -> ShowS) -> Show RenderAs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RenderAs -> ShowS
showsPrec :: Int -> RenderAs -> ShowS
$cshow :: RenderAs -> String
show :: RenderAs -> String
$cshowList :: [RenderAs] -> ShowS
showList :: [RenderAs] -> ShowS
Show, RenderAs -> RenderAs -> Bool
(RenderAs -> RenderAs -> Bool)
-> (RenderAs -> RenderAs -> Bool) -> Eq RenderAs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RenderAs -> RenderAs -> Bool
== :: RenderAs -> RenderAs -> Bool
$c/= :: RenderAs -> RenderAs -> Bool
/= :: RenderAs -> RenderAs -> Bool
Eq)
data IsTemporal
= IsNotTemporal
| IsTemporal
deriving (IsTemporal -> IsTemporal -> Bool
(IsTemporal -> IsTemporal -> Bool)
-> (IsTemporal -> IsTemporal -> Bool) -> Eq IsTemporal
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IsTemporal -> IsTemporal -> Bool
== :: IsTemporal -> IsTemporal -> Bool
$c/= :: IsTemporal -> IsTemporal -> Bool
/= :: IsTemporal -> IsTemporal -> Bool
Eq, Eq IsTemporal
Eq IsTemporal =>
(IsTemporal -> IsTemporal -> Ordering)
-> (IsTemporal -> IsTemporal -> Bool)
-> (IsTemporal -> IsTemporal -> Bool)
-> (IsTemporal -> IsTemporal -> Bool)
-> (IsTemporal -> IsTemporal -> Bool)
-> (IsTemporal -> IsTemporal -> IsTemporal)
-> (IsTemporal -> IsTemporal -> IsTemporal)
-> Ord IsTemporal
IsTemporal -> IsTemporal -> Bool
IsTemporal -> IsTemporal -> Ordering
IsTemporal -> IsTemporal -> IsTemporal
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: IsTemporal -> IsTemporal -> Ordering
compare :: IsTemporal -> IsTemporal -> Ordering
$c< :: IsTemporal -> IsTemporal -> Bool
< :: IsTemporal -> IsTemporal -> Bool
$c<= :: IsTemporal -> IsTemporal -> Bool
<= :: IsTemporal -> IsTemporal -> Bool
$c> :: IsTemporal -> IsTemporal -> Bool
> :: IsTemporal -> IsTemporal -> Bool
$c>= :: IsTemporal -> IsTemporal -> Bool
>= :: IsTemporal -> IsTemporal -> Bool
$cmax :: IsTemporal -> IsTemporal -> IsTemporal
max :: IsTemporal -> IsTemporal -> IsTemporal
$cmin :: IsTemporal -> IsTemporal -> IsTemporal
min :: IsTemporal -> IsTemporal -> IsTemporal
Ord)
data Assertion' a
= CvPure a
| CvToTemporal (Assertion' a)
| CvLit Bool
| CvNot (Assertion' a)
| CvAnd (Assertion' a) (Assertion' a)
| CvOr (Assertion' a) (Assertion' a)
| CvImplies (Assertion' a) (Assertion' a)
| CvNext Word (Assertion' a)
| CvBefore (Assertion' a) (Assertion' a)
| CvTemporalImplies Word (Assertion' a) (Assertion' a)
| CvAlways (Assertion' a)
| CvNever (Assertion' a)
| CvEventually (Assertion' a)
deriving (Int -> Assertion' a -> ShowS
[Assertion' a] -> ShowS
Assertion' a -> String
(Int -> Assertion' a -> ShowS)
-> (Assertion' a -> String)
-> ([Assertion' a] -> ShowS)
-> Show (Assertion' a)
forall a. Show a => Int -> Assertion' a -> ShowS
forall a. Show a => [Assertion' a] -> ShowS
forall a. Show a => Assertion' a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Assertion' a -> ShowS
showsPrec :: Int -> Assertion' a -> ShowS
$cshow :: forall a. Show a => Assertion' a -> String
show :: Assertion' a -> String
$cshowList :: forall a. Show a => [Assertion' a] -> ShowS
showList :: [Assertion' a] -> ShowS
Show, (forall a b. (a -> b) -> Assertion' a -> Assertion' b)
-> (forall a b. a -> Assertion' b -> Assertion' a)
-> Functor Assertion'
forall a b. a -> Assertion' b -> Assertion' a
forall a b. (a -> b) -> Assertion' a -> Assertion' b
forall (f :: Type -> Type).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Assertion' a -> Assertion' b
fmap :: forall a b. (a -> b) -> Assertion' a -> Assertion' b
$c<$ :: forall a b. a -> Assertion' b -> Assertion' a
<$ :: forall a b. a -> Assertion' b -> Assertion' a
Functor, (forall m. Monoid m => Assertion' m -> m)
-> (forall m a. Monoid m => (a -> m) -> Assertion' a -> m)
-> (forall m a. Monoid m => (a -> m) -> Assertion' a -> m)
-> (forall a b. (a -> b -> b) -> b -> Assertion' a -> b)
-> (forall a b. (a -> b -> b) -> b -> Assertion' a -> b)
-> (forall b a. (b -> a -> b) -> b -> Assertion' a -> b)
-> (forall b a. (b -> a -> b) -> b -> Assertion' a -> b)
-> (forall a. (a -> a -> a) -> Assertion' a -> a)
-> (forall a. (a -> a -> a) -> Assertion' a -> a)
-> (forall a. Assertion' a -> [a])
-> (forall a. Assertion' a -> Bool)
-> (forall a. Assertion' a -> Int)
-> (forall a. Eq a => a -> Assertion' a -> Bool)
-> (forall a. Ord a => Assertion' a -> a)
-> (forall a. Ord a => Assertion' a -> a)
-> (forall a. Num a => Assertion' a -> a)
-> (forall a. Num a => Assertion' a -> a)
-> Foldable Assertion'
forall a. Eq a => a -> Assertion' a -> Bool
forall a. Num a => Assertion' a -> a
forall a. Ord a => Assertion' a -> a
forall m. Monoid m => Assertion' m -> m
forall a. Assertion' a -> Bool
forall a. Assertion' a -> Int
forall a. Assertion' a -> [a]
forall a. (a -> a -> a) -> Assertion' a -> a
forall m a. Monoid m => (a -> m) -> Assertion' a -> m
forall b a. (b -> a -> b) -> b -> Assertion' a -> b
forall a b. (a -> b -> b) -> b -> Assertion' a -> b
forall (t :: Type -> Type).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => Assertion' m -> m
fold :: forall m. Monoid m => Assertion' m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Assertion' a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Assertion' a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Assertion' a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> Assertion' a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> Assertion' a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Assertion' a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Assertion' a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Assertion' a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Assertion' a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Assertion' a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Assertion' a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> Assertion' a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> Assertion' a -> a
foldr1 :: forall a. (a -> a -> a) -> Assertion' a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Assertion' a -> a
foldl1 :: forall a. (a -> a -> a) -> Assertion' a -> a
$ctoList :: forall a. Assertion' a -> [a]
toList :: forall a. Assertion' a -> [a]
$cnull :: forall a. Assertion' a -> Bool
null :: forall a. Assertion' a -> Bool
$clength :: forall a. Assertion' a -> Int
length :: forall a. Assertion' a -> Int
$celem :: forall a. Eq a => a -> Assertion' a -> Bool
elem :: forall a. Eq a => a -> Assertion' a -> Bool
$cmaximum :: forall a. Ord a => Assertion' a -> a
maximum :: forall a. Ord a => Assertion' a -> a
$cminimum :: forall a. Ord a => Assertion' a -> a
minimum :: forall a. Ord a => Assertion' a -> a
$csum :: forall a. Num a => Assertion' a -> a
sum :: forall a. Num a => Assertion' a -> a
$cproduct :: forall a. Num a => Assertion' a -> a
product :: forall a. Num a => Assertion' a -> a
Foldable, Functor Assertion'
Foldable Assertion'
(Functor Assertion', Foldable Assertion') =>
(forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Assertion' a -> f (Assertion' b))
-> (forall (f :: Type -> Type) a.
Applicative f =>
Assertion' (f a) -> f (Assertion' a))
-> (forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Assertion' a -> m (Assertion' b))
-> (forall (m :: Type -> Type) a.
Monad m =>
Assertion' (m a) -> m (Assertion' a))
-> Traversable Assertion'
forall (t :: Type -> Type).
(Functor t, Foldable t) =>
(forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: Type -> Type) a.
Applicative f =>
t (f a) -> f (t a))
-> (forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: Type -> Type) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: Type -> Type) a.
Monad m =>
Assertion' (m a) -> m (Assertion' a)
forall (f :: Type -> Type) a.
Applicative f =>
Assertion' (f a) -> f (Assertion' a)
forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Assertion' a -> m (Assertion' b)
forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Assertion' a -> f (Assertion' b)
$ctraverse :: forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Assertion' a -> f (Assertion' b)
traverse :: forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Assertion' a -> f (Assertion' b)
$csequenceA :: forall (f :: Type -> Type) a.
Applicative f =>
Assertion' (f a) -> f (Assertion' a)
sequenceA :: forall (f :: Type -> Type) a.
Applicative f =>
Assertion' (f a) -> f (Assertion' a)
$cmapM :: forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Assertion' a -> m (Assertion' b)
mapM :: forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Assertion' a -> m (Assertion' b)
$csequence :: forall (m :: Type -> Type) a.
Monad m =>
Assertion' (m a) -> m (Assertion' a)
sequence :: forall (m :: Type -> Type) a.
Monad m =>
Assertion' (m a) -> m (Assertion' a)
Traversable)
data Property' a
= CvAssert (Assertion' a)
| CvCover (Assertion' a)
| CvAssume (Assertion' a)
deriving (Int -> Property' a -> ShowS
[Property' a] -> ShowS
Property' a -> String
(Int -> Property' a -> ShowS)
-> (Property' a -> String)
-> ([Property' a] -> ShowS)
-> Show (Property' a)
forall a. Show a => Int -> Property' a -> ShowS
forall a. Show a => [Property' a] -> ShowS
forall a. Show a => Property' a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Property' a -> ShowS
showsPrec :: Int -> Property' a -> ShowS
$cshow :: forall a. Show a => Property' a -> String
show :: Property' a -> String
$cshowList :: forall a. Show a => [Property' a] -> ShowS
showList :: [Property' a] -> ShowS
Show, (forall a b. (a -> b) -> Property' a -> Property' b)
-> (forall a b. a -> Property' b -> Property' a)
-> Functor Property'
forall a b. a -> Property' b -> Property' a
forall a b. (a -> b) -> Property' a -> Property' b
forall (f :: Type -> Type).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Property' a -> Property' b
fmap :: forall a b. (a -> b) -> Property' a -> Property' b
$c<$ :: forall a b. a -> Property' b -> Property' a
<$ :: forall a b. a -> Property' b -> Property' a
Functor, (forall m. Monoid m => Property' m -> m)
-> (forall m a. Monoid m => (a -> m) -> Property' a -> m)
-> (forall m a. Monoid m => (a -> m) -> Property' a -> m)
-> (forall a b. (a -> b -> b) -> b -> Property' a -> b)
-> (forall a b. (a -> b -> b) -> b -> Property' a -> b)
-> (forall b a. (b -> a -> b) -> b -> Property' a -> b)
-> (forall b a. (b -> a -> b) -> b -> Property' a -> b)
-> (forall a. (a -> a -> a) -> Property' a -> a)
-> (forall a. (a -> a -> a) -> Property' a -> a)
-> (forall a. Property' a -> [a])
-> (forall a. Property' a -> Bool)
-> (forall a. Property' a -> Int)
-> (forall a. Eq a => a -> Property' a -> Bool)
-> (forall a. Ord a => Property' a -> a)
-> (forall a. Ord a => Property' a -> a)
-> (forall a. Num a => Property' a -> a)
-> (forall a. Num a => Property' a -> a)
-> Foldable Property'
forall a. Eq a => a -> Property' a -> Bool
forall a. Num a => Property' a -> a
forall a. Ord a => Property' a -> a
forall m. Monoid m => Property' m -> m
forall a. Property' a -> Bool
forall a. Property' a -> Int
forall a. Property' a -> [a]
forall a. (a -> a -> a) -> Property' a -> a
forall m a. Monoid m => (a -> m) -> Property' a -> m
forall b a. (b -> a -> b) -> b -> Property' a -> b
forall a b. (a -> b -> b) -> b -> Property' a -> b
forall (t :: Type -> Type).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => Property' m -> m
fold :: forall m. Monoid m => Property' m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Property' a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Property' a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Property' a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> Property' a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> Property' a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Property' a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Property' a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Property' a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Property' a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Property' a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Property' a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> Property' a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> Property' a -> a
foldr1 :: forall a. (a -> a -> a) -> Property' a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Property' a -> a
foldl1 :: forall a. (a -> a -> a) -> Property' a -> a
$ctoList :: forall a. Property' a -> [a]
toList :: forall a. Property' a -> [a]
$cnull :: forall a. Property' a -> Bool
null :: forall a. Property' a -> Bool
$clength :: forall a. Property' a -> Int
length :: forall a. Property' a -> Int
$celem :: forall a. Eq a => a -> Property' a -> Bool
elem :: forall a. Eq a => a -> Property' a -> Bool
$cmaximum :: forall a. Ord a => Property' a -> a
maximum :: forall a. Ord a => Property' a -> a
$cminimum :: forall a. Ord a => Property' a -> a
minimum :: forall a. Ord a => Property' a -> a
$csum :: forall a. Num a => Property' a -> a
sum :: forall a. Num a => Property' a -> a
$cproduct :: forall a. Num a => Property' a -> a
product :: forall a. Num a => Property' a -> a
Foldable, Functor Property'
Foldable Property'
(Functor Property', Foldable Property') =>
(forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Property' a -> f (Property' b))
-> (forall (f :: Type -> Type) a.
Applicative f =>
Property' (f a) -> f (Property' a))
-> (forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Property' a -> m (Property' b))
-> (forall (m :: Type -> Type) a.
Monad m =>
Property' (m a) -> m (Property' a))
-> Traversable Property'
forall (t :: Type -> Type).
(Functor t, Foldable t) =>
(forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: Type -> Type) a.
Applicative f =>
t (f a) -> f (t a))
-> (forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: Type -> Type) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: Type -> Type) a.
Monad m =>
Property' (m a) -> m (Property' a)
forall (f :: Type -> Type) a.
Applicative f =>
Property' (f a) -> f (Property' a)
forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Property' a -> m (Property' b)
forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Property' a -> f (Property' b)
$ctraverse :: forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Property' a -> f (Property' b)
traverse :: forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Property' a -> f (Property' b)
$csequenceA :: forall (f :: Type -> Type) a.
Applicative f =>
Property' (f a) -> f (Property' a)
sequenceA :: forall (f :: Type -> Type) a.
Applicative f =>
Property' (f a) -> f (Property' a)
$cmapM :: forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Property' a -> m (Property' b)
mapM :: forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Property' a -> m (Property' b)
$csequence :: forall (m :: Type -> Type) a.
Monad m =>
Property' (m a) -> m (Property' a)
sequence :: forall (m :: Type -> Type) a.
Monad m =>
Property' (m a) -> m (Property' a)
Traversable)
data Assertion (dom :: Domain) =
Assertion IsTemporal (Assertion' (Maybe Text, Signal dom Bool))
toTemporal :: Assertion dom -> Assertion' (Maybe Text, Signal dom Bool)
toTemporal :: forall (dom :: Domain).
Assertion dom -> Assertion' (Maybe Text, Signal dom Bool)
toTemporal (Assertion IsTemporal
IsTemporal Assertion' (Maybe Text, Signal dom Bool)
a) = Assertion' (Maybe Text, Signal dom Bool)
a
toTemporal (Assertion IsTemporal
IsNotTemporal Assertion' (Maybe Text, Signal dom Bool)
a) = Assertion' (Maybe Text, Signal dom Bool)
-> Assertion' (Maybe Text, Signal dom Bool)
forall a. Assertion' a -> Assertion' a
CvToTemporal Assertion' (Maybe Text, Signal dom Bool)
a
{-# INLINE toTemporal #-}
isTemporal :: Assertion dom -> IsTemporal
isTemporal :: forall (dom :: Domain). Assertion dom -> IsTemporal
isTemporal (Assertion IsTemporal
it Assertion' (Maybe Text, Signal dom Bool)
_assert) = IsTemporal
it
{-# INLINE isTemporal #-}
assertion :: Assertion dom -> Assertion' (Maybe Text, Signal dom Bool)
assertion :: forall (dom :: Domain).
Assertion dom -> Assertion' (Maybe Text, Signal dom Bool)
assertion (Assertion IsTemporal
_it Assertion' (Maybe Text, Signal dom Bool)
assert) = Assertion' (Maybe Text, Signal dom Bool)
assert
{-# INLINE assertion #-}
newtype Property (dom :: Domain) =
Property (Property' (Maybe Text, Signal dom Bool))
data AssertionResult = AssertionResult
{ AssertionResult -> String
cvPropName :: !String
, AssertionResult -> Bool
cvPass :: !Bool
}
deriving (AssertionResult -> AssertionResult -> Bool
(AssertionResult -> AssertionResult -> Bool)
-> (AssertionResult -> AssertionResult -> Bool)
-> Eq AssertionResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AssertionResult -> AssertionResult -> Bool
== :: AssertionResult -> AssertionResult -> Bool
$c/= :: AssertionResult -> AssertionResult -> Bool
/= :: AssertionResult -> AssertionResult -> Bool
Eq)
{-# ANN module (
DataReprAnn
$(liftQ [t| AssertionResult |])
0
[ ConstrRepr 'AssertionResult 0 0 [0b0, 0b0]
]) #-}
class AssertionValue dom a | a -> dom where
toAssertionValue :: a -> Assertion dom
instance AssertionValue dom (Signal dom Bool) where
toAssertionValue :: Signal dom Bool -> Assertion dom
toAssertionValue Signal dom Bool
s = IsTemporal
-> Assertion' (Maybe Text, Signal dom Bool) -> Assertion dom
forall (dom :: Domain).
IsTemporal
-> Assertion' (Maybe Text, Signal dom Bool) -> Assertion dom
Assertion IsTemporal
IsNotTemporal ((Maybe Text, Signal dom Bool)
-> Assertion' (Maybe Text, Signal dom Bool)
forall a. a -> Assertion' a
CvPure (Maybe Text
forall a. Maybe a
Nothing, Signal dom Bool
s))
{-# INLINE toAssertionValue #-}
instance AssertionValue dom (Assertion dom) where
toAssertionValue :: Assertion dom -> Assertion dom
toAssertionValue = Assertion dom -> Assertion dom
forall a. a -> a
id
{-# INLINE toAssertionValue #-}