module Polysemy.Conc.Data.QueueResult where
data QueueResult d =
Success d
|
NotAvailable
|
Closed
deriving (QueueResult d -> QueueResult d -> Bool
(QueueResult d -> QueueResult d -> Bool)
-> (QueueResult d -> QueueResult d -> Bool) -> Eq (QueueResult d)
forall d. Eq d => QueueResult d -> QueueResult d -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueueResult d -> QueueResult d -> Bool
$c/= :: forall d. Eq d => QueueResult d -> QueueResult d -> Bool
== :: QueueResult d -> QueueResult d -> Bool
$c== :: forall d. Eq d => QueueResult d -> QueueResult d -> Bool
Eq, Int -> QueueResult d -> ShowS
[QueueResult d] -> ShowS
QueueResult d -> String
(Int -> QueueResult d -> ShowS)
-> (QueueResult d -> String)
-> ([QueueResult d] -> ShowS)
-> Show (QueueResult d)
forall d. Show d => Int -> QueueResult d -> ShowS
forall d. Show d => [QueueResult d] -> ShowS
forall d. Show d => QueueResult d -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueueResult d] -> ShowS
$cshowList :: forall d. Show d => [QueueResult d] -> ShowS
show :: QueueResult d -> String
$cshow :: forall d. Show d => QueueResult d -> String
showsPrec :: Int -> QueueResult d -> ShowS
$cshowsPrec :: forall d. Show d => Int -> QueueResult d -> ShowS
Show, Eq (QueueResult d)
Eq (QueueResult d)
-> (QueueResult d -> QueueResult d -> Ordering)
-> (QueueResult d -> QueueResult d -> Bool)
-> (QueueResult d -> QueueResult d -> Bool)
-> (QueueResult d -> QueueResult d -> Bool)
-> (QueueResult d -> QueueResult d -> Bool)
-> (QueueResult d -> QueueResult d -> QueueResult d)
-> (QueueResult d -> QueueResult d -> QueueResult d)
-> Ord (QueueResult d)
QueueResult d -> QueueResult d -> Bool
QueueResult d -> QueueResult d -> Ordering
QueueResult d -> QueueResult d -> QueueResult d
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
forall d. Ord d => Eq (QueueResult d)
forall d. Ord d => QueueResult d -> QueueResult d -> Bool
forall d. Ord d => QueueResult d -> QueueResult d -> Ordering
forall d. Ord d => QueueResult d -> QueueResult d -> QueueResult d
min :: QueueResult d -> QueueResult d -> QueueResult d
$cmin :: forall d. Ord d => QueueResult d -> QueueResult d -> QueueResult d
max :: QueueResult d -> QueueResult d -> QueueResult d
$cmax :: forall d. Ord d => QueueResult d -> QueueResult d -> QueueResult d
>= :: QueueResult d -> QueueResult d -> Bool
$c>= :: forall d. Ord d => QueueResult d -> QueueResult d -> Bool
> :: QueueResult d -> QueueResult d -> Bool
$c> :: forall d. Ord d => QueueResult d -> QueueResult d -> Bool
<= :: QueueResult d -> QueueResult d -> Bool
$c<= :: forall d. Ord d => QueueResult d -> QueueResult d -> Bool
< :: QueueResult d -> QueueResult d -> Bool
$c< :: forall d. Ord d => QueueResult d -> QueueResult d -> Bool
compare :: QueueResult d -> QueueResult d -> Ordering
$ccompare :: forall d. Ord d => QueueResult d -> QueueResult d -> Ordering
$cp1Ord :: forall d. Ord d => Eq (QueueResult d)
Ord, a -> QueueResult b -> QueueResult a
(a -> b) -> QueueResult a -> QueueResult b
(forall a b. (a -> b) -> QueueResult a -> QueueResult b)
-> (forall a b. a -> QueueResult b -> QueueResult a)
-> Functor QueueResult
forall a b. a -> QueueResult b -> QueueResult a
forall a b. (a -> b) -> QueueResult a -> QueueResult b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> QueueResult b -> QueueResult a
$c<$ :: forall a b. a -> QueueResult b -> QueueResult a
fmap :: (a -> b) -> QueueResult a -> QueueResult b
$cfmap :: forall a b. (a -> b) -> QueueResult a -> QueueResult b
Functor, (forall x. QueueResult d -> Rep (QueueResult d) x)
-> (forall x. Rep (QueueResult d) x -> QueueResult d)
-> Generic (QueueResult d)
forall x. Rep (QueueResult d) x -> QueueResult d
forall x. QueueResult d -> Rep (QueueResult d) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall d x. Rep (QueueResult d) x -> QueueResult d
forall d x. QueueResult d -> Rep (QueueResult d) x
$cto :: forall d x. Rep (QueueResult d) x -> QueueResult d
$cfrom :: forall d x. QueueResult d -> Rep (QueueResult d) x
Generic)
instance Semigroup d => Semigroup (QueueResult d) where
Success d
d1 <> :: QueueResult d -> QueueResult d -> QueueResult d
<> Success d
d2 = d -> QueueResult d
forall d. d -> QueueResult d
Success (d
d1 d -> d -> d
forall a. Semigroup a => a -> a -> a
<> d
d2)
QueueResult d
Closed <> QueueResult d
_ = QueueResult d
forall d. QueueResult d
Closed
QueueResult d
_ <> QueueResult d
Closed = QueueResult d
forall d. QueueResult d
Closed
QueueResult d
NotAvailable <> QueueResult d
_ = QueueResult d
forall d. QueueResult d
NotAvailable
QueueResult d
_ <> QueueResult d
NotAvailable = QueueResult d
forall d. QueueResult d
NotAvailable
instance Monoid d => Monoid (QueueResult d) where
mempty :: QueueResult d
mempty = d -> QueueResult d
forall d. d -> QueueResult d
Success d
forall a. Monoid a => a
mempty