{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE TypeOperators #-}
module Algebra.Lattice.Op (
Op(..)
) where
import Prelude ()
import Prelude.Compat
import Algebra.Lattice
import Algebra.PartialOrd
import Control.DeepSeq (NFData (..))
import Control.Monad (ap)
import Data.Data (Data, Typeable)
import Data.Hashable (Hashable (..))
import Data.Universe.Class (Finite (..), Universe (..))
import GHC.Generics (Generic, Generic1)
import qualified Test.QuickCheck as QC
newtype Op a = Op { Op a -> a
getOp :: a }
deriving ( Op a -> Op a -> Bool
(Op a -> Op a -> Bool) -> (Op a -> Op a -> Bool) -> Eq (Op a)
forall a. Eq a => Op a -> Op a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Op a -> Op a -> Bool
$c/= :: forall a. Eq a => Op a -> Op a -> Bool
== :: Op a -> Op a -> Bool
$c== :: forall a. Eq a => Op a -> Op a -> Bool
Eq, Int -> Op a -> ShowS
[Op a] -> ShowS
Op a -> String
(Int -> Op a -> ShowS)
-> (Op a -> String) -> ([Op a] -> ShowS) -> Show (Op a)
forall a. Show a => Int -> Op a -> ShowS
forall a. Show a => [Op a] -> ShowS
forall a. Show a => Op a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Op a] -> ShowS
$cshowList :: forall a. Show a => [Op a] -> ShowS
show :: Op a -> String
$cshow :: forall a. Show a => Op a -> String
showsPrec :: Int -> Op a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Op a -> ShowS
Show, ReadPrec [Op a]
ReadPrec (Op a)
Int -> ReadS (Op a)
ReadS [Op a]
(Int -> ReadS (Op a))
-> ReadS [Op a]
-> ReadPrec (Op a)
-> ReadPrec [Op a]
-> Read (Op a)
forall a. Read a => ReadPrec [Op a]
forall a. Read a => ReadPrec (Op a)
forall a. Read a => Int -> ReadS (Op a)
forall a. Read a => ReadS [Op a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Op a]
$creadListPrec :: forall a. Read a => ReadPrec [Op a]
readPrec :: ReadPrec (Op a)
$creadPrec :: forall a. Read a => ReadPrec (Op a)
readList :: ReadS [Op a]
$creadList :: forall a. Read a => ReadS [Op a]
readsPrec :: Int -> ReadS (Op a)
$creadsPrec :: forall a. Read a => Int -> ReadS (Op a)
Read, Typeable (Op a)
DataType
Constr
Typeable (Op a)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Op a -> c (Op a))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Op a))
-> (Op a -> Constr)
-> (Op a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Op a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Op a)))
-> ((forall b. Data b => b -> b) -> Op a -> Op a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Op a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Op a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Op a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Op a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Op a -> m (Op a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Op a -> m (Op a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Op a -> m (Op a))
-> Data (Op a)
Op a -> DataType
Op a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Op a))
(forall b. Data b => b -> b) -> Op a -> Op a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Op a -> c (Op a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Op a)
forall a. Data a => Typeable (Op a)
forall a. Data a => Op a -> DataType
forall a. Data a => Op a -> Constr
forall a. Data a => (forall b. Data b => b -> b) -> Op a -> Op a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Op a -> u
forall a u. Data a => (forall d. Data d => d -> u) -> Op a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Op a -> r
forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Op a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Op a -> m (Op a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Op a -> m (Op a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Op a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Op a -> c (Op a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Op a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Op a))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Op a -> u
forall u. (forall d. Data d => d -> u) -> Op a -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Op a -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Op a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Op a -> m (Op a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Op a -> m (Op a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Op a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Op a -> c (Op a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Op a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Op a))
$cOp :: Constr
$tOp :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Op a -> m (Op a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Op a -> m (Op a)
gmapMp :: (forall d. Data d => d -> m d) -> Op a -> m (Op a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Op a -> m (Op a)
gmapM :: (forall d. Data d => d -> m d) -> Op a -> m (Op a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Op a -> m (Op a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Op a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Op a -> u
gmapQ :: (forall d. Data d => d -> u) -> Op a -> [u]
$cgmapQ :: forall a u. Data a => (forall d. Data d => d -> u) -> Op a -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Op a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Op a -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Op a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Op a -> r
gmapT :: (forall b. Data b => b -> b) -> Op a -> Op a
$cgmapT :: forall a. Data a => (forall b. Data b => b -> b) -> Op a -> Op a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Op a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Op a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Op a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Op a))
dataTypeOf :: Op a -> DataType
$cdataTypeOf :: forall a. Data a => Op a -> DataType
toConstr :: Op a -> Constr
$ctoConstr :: forall a. Data a => Op a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Op a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Op a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Op a -> c (Op a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Op a -> c (Op a)
$cp1Data :: forall a. Data a => Typeable (Op a)
Data, Typeable, (forall x. Op a -> Rep (Op a) x)
-> (forall x. Rep (Op a) x -> Op a) -> Generic (Op a)
forall x. Rep (Op a) x -> Op a
forall x. Op a -> Rep (Op a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Op a) x -> Op a
forall a x. Op a -> Rep (Op a) x
$cto :: forall a x. Rep (Op a) x -> Op a
$cfrom :: forall a x. Op a -> Rep (Op a) x
Generic, a -> Op b -> Op a
(a -> b) -> Op a -> Op b
(forall a b. (a -> b) -> Op a -> Op b)
-> (forall a b. a -> Op b -> Op a) -> Functor Op
forall a b. a -> Op b -> Op a
forall a b. (a -> b) -> Op a -> Op b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Op b -> Op a
$c<$ :: forall a b. a -> Op b -> Op a
fmap :: (a -> b) -> Op a -> Op b
$cfmap :: forall a b. (a -> b) -> Op a -> Op b
Functor, Op a -> Bool
(a -> m) -> Op a -> m
(a -> b -> b) -> b -> Op a -> b
(forall m. Monoid m => Op m -> m)
-> (forall m a. Monoid m => (a -> m) -> Op a -> m)
-> (forall m a. Monoid m => (a -> m) -> Op a -> m)
-> (forall a b. (a -> b -> b) -> b -> Op a -> b)
-> (forall a b. (a -> b -> b) -> b -> Op a -> b)
-> (forall b a. (b -> a -> b) -> b -> Op a -> b)
-> (forall b a. (b -> a -> b) -> b -> Op a -> b)
-> (forall a. (a -> a -> a) -> Op a -> a)
-> (forall a. (a -> a -> a) -> Op a -> a)
-> (forall a. Op a -> [a])
-> (forall a. Op a -> Bool)
-> (forall a. Op a -> Int)
-> (forall a. Eq a => a -> Op a -> Bool)
-> (forall a. Ord a => Op a -> a)
-> (forall a. Ord a => Op a -> a)
-> (forall a. Num a => Op a -> a)
-> (forall a. Num a => Op a -> a)
-> Foldable Op
forall a. Eq a => a -> Op a -> Bool
forall a. Num a => Op a -> a
forall a. Ord a => Op a -> a
forall m. Monoid m => Op m -> m
forall a. Op a -> Bool
forall a. Op a -> Int
forall a. Op a -> [a]
forall a. (a -> a -> a) -> Op a -> a
forall m a. Monoid m => (a -> m) -> Op a -> m
forall b a. (b -> a -> b) -> b -> Op a -> b
forall a b. (a -> b -> b) -> b -> Op a -> b
forall (t :: * -> *).
(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
product :: Op a -> a
$cproduct :: forall a. Num a => Op a -> a
sum :: Op a -> a
$csum :: forall a. Num a => Op a -> a
minimum :: Op a -> a
$cminimum :: forall a. Ord a => Op a -> a
maximum :: Op a -> a
$cmaximum :: forall a. Ord a => Op a -> a
elem :: a -> Op a -> Bool
$celem :: forall a. Eq a => a -> Op a -> Bool
length :: Op a -> Int
$clength :: forall a. Op a -> Int
null :: Op a -> Bool
$cnull :: forall a. Op a -> Bool
toList :: Op a -> [a]
$ctoList :: forall a. Op a -> [a]
foldl1 :: (a -> a -> a) -> Op a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Op a -> a
foldr1 :: (a -> a -> a) -> Op a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Op a -> a
foldl' :: (b -> a -> b) -> b -> Op a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Op a -> b
foldl :: (b -> a -> b) -> b -> Op a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Op a -> b
foldr' :: (a -> b -> b) -> b -> Op a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Op a -> b
foldr :: (a -> b -> b) -> b -> Op a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Op a -> b
foldMap' :: (a -> m) -> Op a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Op a -> m
foldMap :: (a -> m) -> Op a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Op a -> m
fold :: Op m -> m
$cfold :: forall m. Monoid m => Op m -> m
Foldable, Functor Op
Foldable Op
Functor Op
-> Foldable Op
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Op a -> f (Op b))
-> (forall (f :: * -> *) a. Applicative f => Op (f a) -> f (Op a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Op a -> m (Op b))
-> (forall (m :: * -> *) a. Monad m => Op (m a) -> m (Op a))
-> Traversable Op
(a -> f b) -> Op a -> f (Op b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Op (m a) -> m (Op a)
forall (f :: * -> *) a. Applicative f => Op (f a) -> f (Op a)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> Op a -> m (Op b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Op a -> f (Op b)
sequence :: Op (m a) -> m (Op a)
$csequence :: forall (m :: * -> *) a. Monad m => Op (m a) -> m (Op a)
mapM :: (a -> m b) -> Op a -> m (Op b)
$cmapM :: forall (m :: * -> *) a b. Monad m => (a -> m b) -> Op a -> m (Op b)
sequenceA :: Op (f a) -> f (Op a)
$csequenceA :: forall (f :: * -> *) a. Applicative f => Op (f a) -> f (Op a)
traverse :: (a -> f b) -> Op a -> f (Op b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Op a -> f (Op b)
$cp2Traversable :: Foldable Op
$cp1Traversable :: Functor Op
Traversable
, (forall a. Op a -> Rep1 Op a)
-> (forall a. Rep1 Op a -> Op a) -> Generic1 Op
forall a. Rep1 Op a -> Op a
forall a. Op a -> Rep1 Op a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 Op a -> Op a
$cfrom1 :: forall a. Op a -> Rep1 Op a
Generic1
)
instance Ord a => Ord (Op a) where
compare :: Op a -> Op a -> Ordering
compare (Op a
a) (Op a
b) = a -> a -> Ordering
forall a. Ord a => a -> a -> Ordering
compare a
b a
a
instance Applicative Op where
pure :: a -> Op a
pure = a -> Op a
forall (m :: * -> *) a. Monad m => a -> m a
return
<*> :: Op (a -> b) -> Op a -> Op b
(<*>) = Op (a -> b) -> Op a -> Op b
forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
ap
instance Monad Op where
return :: a -> Op a
return = a -> Op a
forall a. a -> Op a
Op
Op a
x >>= :: Op a -> (a -> Op b) -> Op b
>>= a -> Op b
f = a -> Op b
f a
x
instance NFData a => NFData (Op a) where
rnf :: Op a -> ()
rnf (Op a
a) = a -> ()
forall a. NFData a => a -> ()
rnf a
a
instance Hashable a => Hashable (Op a)
instance Lattice a => Lattice (Op a) where
Op a
x \/ :: Op a -> Op a -> Op a
\/ Op a
y = a -> Op a
forall a. a -> Op a
Op (a
x a -> a -> a
forall a. Lattice a => a -> a -> a
/\ a
y)
Op a
x /\ :: Op a -> Op a -> Op a
/\ Op a
y = a -> Op a
forall a. a -> Op a
Op (a
x a -> a -> a
forall a. Lattice a => a -> a -> a
\/ a
y)
instance BoundedMeetSemiLattice a => BoundedJoinSemiLattice (Op a) where
bottom :: Op a
bottom = a -> Op a
forall a. a -> Op a
Op a
forall a. BoundedMeetSemiLattice a => a
top
instance BoundedJoinSemiLattice a => BoundedMeetSemiLattice (Op a) where
top :: Op a
top = a -> Op a
forall a. a -> Op a
Op a
forall a. BoundedJoinSemiLattice a => a
bottom
instance PartialOrd a => PartialOrd (Op a) where
Op a
a leq :: Op a -> Op a -> Bool
`leq` Op a
b = a
b a -> a -> Bool
forall a. PartialOrd a => a -> a -> Bool
`leq` a
a
comparable :: Op a -> Op a -> Bool
comparable (Op a
a) (Op a
b) = a -> a -> Bool
forall a. PartialOrd a => a -> a -> Bool
comparable a
a a
b
instance Universe a => Universe (Op a) where
universe :: [Op a]
universe = (a -> Op a) -> [a] -> [Op a]
forall a b. (a -> b) -> [a] -> [b]
map a -> Op a
forall a. a -> Op a
Op [a]
forall a. Universe a => [a]
universe
instance Finite a => Finite (Op a) where
universeF :: [Op a]
universeF = (a -> Op a) -> [a] -> [Op a]
forall a b. (a -> b) -> [a] -> [b]
map a -> Op a
forall a. a -> Op a
Op [a]
forall a. Finite a => [a]
universeF
instance QC.Arbitrary a => QC.Arbitrary (Op a) where
arbitrary :: Gen (Op a)
arbitrary = a -> Op a
forall a. a -> Op a
Op (a -> Op a) -> Gen a -> Gen (Op a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Gen a
forall a. Arbitrary a => Gen a
QC.arbitrary
shrink :: Op a -> [Op a]
shrink = (Op (Op a) -> Op a) -> (Op a -> Op (Op a)) -> Op a -> [Op a]
forall a b. Arbitrary a => (a -> b) -> (b -> a) -> b -> [b]
QC.shrinkMap Op (Op a) -> Op a
forall a. Op a -> a
getOp Op a -> Op (Op a)
forall a. a -> Op a
Op
instance QC.CoArbitrary a => QC.CoArbitrary (Op a) where
coarbitrary :: Op a -> Gen b -> Gen b
coarbitrary = a -> Gen b -> Gen b
forall a b. CoArbitrary a => a -> Gen b -> Gen b
QC.coarbitrary (a -> Gen b -> Gen b) -> (Op a -> a) -> Op a -> Gen b -> Gen b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Op a -> a
forall a. Op a -> a
getOp
instance QC.Function a => QC.Function (Op a) where
function :: (Op a -> b) -> Op a :-> b
function = (Op a -> a) -> (a -> Op a) -> (Op a -> b) -> Op a :-> b
forall b a c.
Function b =>
(a -> b) -> (b -> a) -> (a -> c) -> a :-> c
QC.functionMap Op a -> a
forall a. Op a -> a
getOp a -> Op a
forall a. a -> Op a
Op