{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -Wno-orphans #-}
{-# LANGUAGE InstanceSigs #-}
module Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (..)) where
import GHC.Generics (Generic)
data PeerSharing = PeerSharingDisabled
| PeerSharingEnabled
deriving (PeerSharing -> PeerSharing -> Bool
(PeerSharing -> PeerSharing -> Bool)
-> (PeerSharing -> PeerSharing -> Bool) -> Eq PeerSharing
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PeerSharing -> PeerSharing -> Bool
== :: PeerSharing -> PeerSharing -> Bool
$c/= :: PeerSharing -> PeerSharing -> Bool
/= :: PeerSharing -> PeerSharing -> Bool
Eq, Int -> PeerSharing -> ShowS
[PeerSharing] -> ShowS
PeerSharing -> String
(Int -> PeerSharing -> ShowS)
-> (PeerSharing -> String)
-> ([PeerSharing] -> ShowS)
-> Show PeerSharing
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PeerSharing -> ShowS
showsPrec :: Int -> PeerSharing -> ShowS
$cshow :: PeerSharing -> String
show :: PeerSharing -> String
$cshowList :: [PeerSharing] -> ShowS
showList :: [PeerSharing] -> ShowS
Show, ReadPrec [PeerSharing]
ReadPrec PeerSharing
Int -> ReadS PeerSharing
ReadS [PeerSharing]
(Int -> ReadS PeerSharing)
-> ReadS [PeerSharing]
-> ReadPrec PeerSharing
-> ReadPrec [PeerSharing]
-> Read PeerSharing
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS PeerSharing
readsPrec :: Int -> ReadS PeerSharing
$creadList :: ReadS [PeerSharing]
readList :: ReadS [PeerSharing]
$creadPrec :: ReadPrec PeerSharing
readPrec :: ReadPrec PeerSharing
$creadListPrec :: ReadPrec [PeerSharing]
readListPrec :: ReadPrec [PeerSharing]
Read, (forall x. PeerSharing -> Rep PeerSharing x)
-> (forall x. Rep PeerSharing x -> PeerSharing)
-> Generic PeerSharing
forall x. Rep PeerSharing x -> PeerSharing
forall x. PeerSharing -> Rep PeerSharing x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PeerSharing -> Rep PeerSharing x
from :: forall x. PeerSharing -> Rep PeerSharing x
$cto :: forall x. Rep PeerSharing x -> PeerSharing
to :: forall x. Rep PeerSharing x -> PeerSharing
Generic)
instance Semigroup PeerSharing where
(<>) :: PeerSharing -> PeerSharing -> PeerSharing
PeerSharing
PeerSharingDisabled <> :: PeerSharing -> PeerSharing -> PeerSharing
<> PeerSharing
_ = PeerSharing
PeerSharingDisabled
PeerSharing
_ <> PeerSharing
PeerSharingDisabled = PeerSharing
PeerSharingDisabled
PeerSharing
_ <> PeerSharing
_ = PeerSharing
PeerSharingEnabled
instance Monoid PeerSharing where
mempty :: PeerSharing
mempty :: PeerSharing
mempty = PeerSharing
PeerSharingEnabled