    {-# LANGUAGE
          CPP,
          FlexibleInstances,
          GeneralizedNewtypeDeriving,
          DeriveDataTypeable
      #-}
    module Data.Algebra.Boolean(
      Boolean(..),
      fromBool,
      Bitwise(..),
      and,
      or,
      nand,
      nor,
      any,
      all,
      Opp(..),
      AnyB(..),
      AllB(..),
      XorB(..),
      EquivB(..),
      ) where
    import Data.Monoid (Any(..), All(..), Dual(..), Endo(..))
    import Data.Bits (Bits, complement, (.|.), (.&.))
    import qualified Data.Bits as Bits
    import Data.Function (on)
    #if MIN_VERSION_base(4,11,0)
    import Data.Semigroup (Semigroup(..), stimesIdempotentMonoid)
    #elif MIN_VERSION_base(4,9,0)
    #else
    import Data.Monoid (Monoid(..))
    #endif
    import Data.Typeable
    import Data.Data
    import Data.Ix
    import qualified Data.Foldable as F
    import Foreign.Storable
    import Text.Printf
    import Prelude hiding ((&&), (||), not, and, or, any, all)
    import qualified Prelude as P

    infixr  1 <-->, `xor`, -->
    infixr  2 ||
    infixr  3 &&

    -- |A class for boolean algebras. Instances of this class are expected to obey
    -- all the laws of [boolean algebra](https://en.wikipedia.org/wiki/Boolean_algebra_(structure)).
    --
    -- Minimal complete definition: 'true' or 'false', 'not' or ('<-->', 'false'), '||' or '&&'.
    class Boolean b where
      -- |Truth value, defined as the top of the bounded lattice
      true    :: b
      -- |False value, defined as the bottom of the bounded lattice.
      false   :: b
      -- |Logical negation.
      not     :: b -> b
      -- |Logical conjunction. (infixr 3)
      (&&)    :: b -> b -> b
      -- |Logical inclusive disjunction. (infixr 2)
      (||)    :: b -> b -> b
      -- |Logical exclusive disjunction. (infixr 1)
      xor   :: b -> b -> b
      -- |Logical implication. (infixr 1)
      (-->) :: b -> b -> b
      -- |Logical biconditional. (infixr 1)
      (<-->) :: b -> b -> b

      {-# MINIMAL (false | true), (not | ((<-->), false)), ((||) | (&&)) #-}

      -- Default implementations
      true      = b -> b
    forall b. Boolean b => b -> b
    not b
    forall b. Boolean b => b
    false
      false     = b -> b
    forall b. Boolean b => b -> b
    not b
    forall b. Boolean b => b
    true
      not       = (b -> b -> b
    forall b. Boolean b => b -> b -> b
    <--> b
    forall b. Boolean b => b
    false)
      b
    x && b
    y    = b -> b
    forall b. Boolean b => b -> b
    not (b -> b
    forall b. Boolean b => b -> b
    not b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    || b -> b
    forall b. Boolean b => b -> b
    not b
    y)
      b
    x || b
    y    = b -> b
    forall b. Boolean b => b -> b
    not (b -> b
    forall b. Boolean b => b -> b
    not b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    && b -> b
    forall b. Boolean b => b -> b
    not b
    y)
      b
    x `xor` b
    y = (b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    || b
    y) b -> b -> b
    forall b. Boolean b => b -> b -> b
    && (b -> b
    forall b. Boolean b => b -> b
    not (b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    && b
    y))
      b
    x --> b
    y   = b -> b
    forall b. Boolean b => b -> b
    not b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    || b
    y
      b
    x <--> b
    y  = (b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    && b
    y) b -> b -> b
    forall b. Boolean b => b -> b -> b
    || b -> b
    forall b. Boolean b => b -> b
    not (b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    || b
    y)

    -- | The logical conjunction of several values.
    and :: (Boolean b, F.Foldable t) => t b -> b
    and :: forall b (t :: * -> *). (Boolean b, Foldable t) => t b -> b
    and = (b -> b -> b) -> b -> t b -> b
    forall b a. (b -> a -> b) -> b -> t a -> b
    forall (t :: * -> *) b a.
    Foldable t =>
    (b -> a -> b) -> b -> t a -> b
    F.foldl' b -> b -> b
    forall b. Boolean b => b -> b -> b
    (&&) b
    forall b. Boolean b => b
    true

    -- | The logical disjunction of several values.
    or :: (Boolean b, F.Foldable t) => t b -> b
    or :: forall b (t :: * -> *). (Boolean b, Foldable t) => t b -> b
    or = (b -> b -> b) -> b -> t b -> b
    forall b a. (b -> a -> b) -> b -> t a -> b
    forall (t :: * -> *) b a.
    Foldable t =>
    (b -> a -> b) -> b -> t a -> b
    F.foldl' b -> b -> b
    forall b. Boolean b => b -> b -> b
    (||) b
    forall b. Boolean b => b
    false

    -- | The negated logical conjunction of several values.
    --
    -- @'nand' = 'not' . 'and'@
    nand :: (Boolean b, F.Foldable t) => t b -> b
    nand :: forall b (t :: * -> *). (Boolean b, Foldable t) => t b -> b
    nand = b -> b
    forall b. Boolean b => b -> b
    not (b -> b) -> (t b -> b) -> t b -> b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . t b -> b
    forall b (t :: * -> *). (Boolean b, Foldable t) => t b -> b
    and

    -- | The negated logical disjunction of several values.
    --
    -- @'nor' = 'not' . 'or'@
    nor :: (Boolean b, F.Foldable t) => t b -> b
    nor :: forall b (t :: * -> *). (Boolean b, Foldable t) => t b -> b
    nor = b -> b
    forall b. Boolean b => b -> b
    not (b -> b) -> (t b -> b) -> t b -> b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . t b -> b
    forall b (t :: * -> *). (Boolean b, Foldable t) => t b -> b
    or

    -- | The logical conjunction of the mapping of a function over several values.
    all :: (Boolean b, F.Foldable t) => (a -> b) -> t a -> b
    all :: forall b (t :: * -> *) a.
    (Boolean b, Foldable t) =>
    (a -> b) -> t a -> b
    all a -> b
    p = (b -> a -> b) -> b -> t a -> b
    forall b a. (b -> a -> b) -> b -> t a -> b
    forall (t :: * -> *) b a.
    Foldable t =>
    (b -> a -> b) -> b -> t a -> b
    F.foldl' b -> a -> b
    f b
    forall b. Boolean b => b
    true
      where f :: b -> a -> b
    f b
    a a
    b = b
    a b -> b -> b
    forall b. Boolean b => b -> b -> b
    && a -> b
    p a
    b

    -- | The logical disjunction of the mapping of a function over several values.
    any :: (Boolean b, F.Foldable t) => (a -> b) -> t a -> b
    any :: forall b (t :: * -> *) a.
    (Boolean b, Foldable t) =>
    (a -> b) -> t a -> b
    any a -> b
    p     = (b -> a -> b) -> b -> t a -> b
    forall b a. (b -> a -> b) -> b -> t a -> b
    forall (t :: * -> *) b a.
    Foldable t =>
    (b -> a -> b) -> b -> t a -> b
    F.foldl' b -> a -> b
    f b
    forall b. Boolean b => b
    false
      where f :: b -> a -> b
    f b
    a a
    b = b
    a b -> b -> b
    forall b. Boolean b => b -> b -> b
    || a -> b
    p a
    b

    -- | A boolean algebra regarded as a monoid under disjunction
    newtype AnyB b = AnyB {
      forall b. AnyB b -> b
    getAnyB :: b
    } deriving (AnyB b -> AnyB b -> Bool
    (AnyB b -> AnyB b -> Bool)
    -> (AnyB b -> AnyB b -> Bool) -> Eq (AnyB b)
    forall b. Eq b => AnyB b -> AnyB b -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall b. Eq b => AnyB b -> AnyB b -> Bool
    == :: AnyB b -> AnyB b -> Bool
    $c/= :: forall b. Eq b => AnyB b -> AnyB b -> Bool
    /= :: AnyB b -> AnyB b -> Bool
    Eq, Eq (AnyB b)
    Eq (AnyB b) =>
    (AnyB b -> AnyB b -> Ordering)
    -> (AnyB b -> AnyB b -> Bool)
    -> (AnyB b -> AnyB b -> Bool)
    -> (AnyB b -> AnyB b -> Bool)
    -> (AnyB b -> AnyB b -> Bool)
    -> (AnyB b -> AnyB b -> AnyB b)
    -> (AnyB b -> AnyB b -> AnyB b)
    -> Ord (AnyB b)
    AnyB b -> AnyB b -> Bool
    AnyB b -> AnyB b -> Ordering
    AnyB b -> AnyB b -> AnyB b
    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 b. Ord b => Eq (AnyB b)
    forall b. Ord b => AnyB b -> AnyB b -> Bool
    forall b. Ord b => AnyB b -> AnyB b -> Ordering
    forall b. Ord b => AnyB b -> AnyB b -> AnyB b
    $ccompare :: forall b. Ord b => AnyB b -> AnyB b -> Ordering
    compare :: AnyB b -> AnyB b -> Ordering
    $c< :: forall b. Ord b => AnyB b -> AnyB b -> Bool
    < :: AnyB b -> AnyB b -> Bool
    $c<= :: forall b. Ord b => AnyB b -> AnyB b -> Bool
    <= :: AnyB b -> AnyB b -> Bool
    $c> :: forall b. Ord b => AnyB b -> AnyB b -> Bool
    > :: AnyB b -> AnyB b -> Bool
    $c>= :: forall b. Ord b => AnyB b -> AnyB b -> Bool
    >= :: AnyB b -> AnyB b -> Bool
    $cmax :: forall b. Ord b => AnyB b -> AnyB b -> AnyB b
    max :: AnyB b -> AnyB b -> AnyB b
    $cmin :: forall b. Ord b => AnyB b -> AnyB b -> AnyB b
    min :: AnyB b -> AnyB b -> AnyB b
    Ord, Int -> AnyB b -> ShowS
    [AnyB b] -> ShowS
    AnyB b -> String
    (Int -> AnyB b -> ShowS)
    -> (AnyB b -> String) -> ([AnyB b] -> ShowS) -> Show (AnyB b)
    forall b. Show b => Int -> AnyB b -> ShowS
    forall b. Show b => [AnyB b] -> ShowS
    forall b. Show b => AnyB b -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall b. Show b => Int -> AnyB b -> ShowS
    showsPrec :: Int -> AnyB b -> ShowS
    $cshow :: forall b. Show b => AnyB b -> String
    show :: AnyB b -> String
    $cshowList :: forall b. Show b => [AnyB b] -> ShowS
    showList :: [AnyB b] -> ShowS
    Show)

    #if MIN_VERSION_base(4,11,0)
    instance Boolean b => Semigroup (AnyB b) where
      AnyB b
    x <> :: AnyB b -> AnyB b -> AnyB b
    <> AnyB b
    y = b -> AnyB b
    forall b. b -> AnyB b
    AnyB (b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    || b
    y)
      stimes :: forall b. Integral b => b -> AnyB b -> AnyB b
    stimes = b -> AnyB b -> AnyB b
    forall b a. (Integral b, Monoid a) => b -> a -> a
    stimesIdempotentMonoid

    instance Boolean b => Monoid (AnyB b) where
      mempty :: AnyB b
    mempty = b -> AnyB b
    forall b. b -> AnyB b
    AnyB b
    forall b. Boolean b => b
    false
    #else
    instance Boolean b => Monoid (AnyB b) where
      mappend (AnyB x) (AnyB y) = AnyB (x || y)
      mempty = AnyB false
    #endif

    -- | A boolean algebra regarded as a monoid under conjunction
    newtype AllB b = AllB {
      forall b. AllB b -> b
    getAllB :: b
    } deriving (AllB b -> AllB b -> Bool
    (AllB b -> AllB b -> Bool)
    -> (AllB b -> AllB b -> Bool) -> Eq (AllB b)
    forall b. Eq b => AllB b -> AllB b -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall b. Eq b => AllB b -> AllB b -> Bool
    == :: AllB b -> AllB b -> Bool
    $c/= :: forall b. Eq b => AllB b -> AllB b -> Bool
    /= :: AllB b -> AllB b -> Bool
    Eq, Eq (AllB b)
    Eq (AllB b) =>
    (AllB b -> AllB b -> Ordering)
    -> (AllB b -> AllB b -> Bool)
    -> (AllB b -> AllB b -> Bool)
    -> (AllB b -> AllB b -> Bool)
    -> (AllB b -> AllB b -> Bool)
    -> (AllB b -> AllB b -> AllB b)
    -> (AllB b -> AllB b -> AllB b)
    -> Ord (AllB b)
    AllB b -> AllB b -> Bool
    AllB b -> AllB b -> Ordering
    AllB b -> AllB b -> AllB b
    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 b. Ord b => Eq (AllB b)
    forall b. Ord b => AllB b -> AllB b -> Bool
    forall b. Ord b => AllB b -> AllB b -> Ordering
    forall b. Ord b => AllB b -> AllB b -> AllB b
    $ccompare :: forall b. Ord b => AllB b -> AllB b -> Ordering
    compare :: AllB b -> AllB b -> Ordering
    $c< :: forall b. Ord b => AllB b -> AllB b -> Bool
    < :: AllB b -> AllB b -> Bool
    $c<= :: forall b. Ord b => AllB b -> AllB b -> Bool
    <= :: AllB b -> AllB b -> Bool
    $c> :: forall b. Ord b => AllB b -> AllB b -> Bool
    > :: AllB b -> AllB b -> Bool
    $c>= :: forall b. Ord b => AllB b -> AllB b -> Bool
    >= :: AllB b -> AllB b -> Bool
    $cmax :: forall b. Ord b => AllB b -> AllB b -> AllB b
    max :: AllB b -> AllB b -> AllB b
    $cmin :: forall b. Ord b => AllB b -> AllB b -> AllB b
    min :: AllB b -> AllB b -> AllB b
    Ord, Int -> AllB b -> ShowS
    [AllB b] -> ShowS
    AllB b -> String
    (Int -> AllB b -> ShowS)
    -> (AllB b -> String) -> ([AllB b] -> ShowS) -> Show (AllB b)
    forall b. Show b => Int -> AllB b -> ShowS
    forall b. Show b => [AllB b] -> ShowS
    forall b. Show b => AllB b -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall b. Show b => Int -> AllB b -> ShowS
    showsPrec :: Int -> AllB b -> ShowS
    $cshow :: forall b. Show b => AllB b -> String
    show :: AllB b -> String
    $cshowList :: forall b. Show b => [AllB b] -> ShowS
    showList :: [AllB b] -> ShowS
    Show)

    #if MIN_VERSION_base(4,11,0)
    instance Boolean b => Semigroup (AllB b) where
      AllB b
    x <> :: AllB b -> AllB b -> AllB b
    <> AllB b
    y = b -> AllB b
    forall b. b -> AllB b
    AllB (b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    && b
    y)
      stimes :: forall b. Integral b => b -> AllB b -> AllB b
    stimes = b -> AllB b -> AllB b
    forall b a. (Integral b, Monoid a) => b -> a -> a
    stimesIdempotentMonoid

    instance Boolean b => Monoid (AllB b) where
      mempty :: AllB b
    mempty = b -> AllB b
    forall b. b -> AllB b
    AllB b
    forall b. Boolean b => b
    true
    #else
    instance Boolean b => Monoid (AllB b) where
      mappend (AllB x) (AllB y) = AllB (x && y)
      mempty = AllB true
    #endif

    -- | `stimes` for a group of exponent 2
    stimesPeriod2 :: (Monoid a, Integral n) => n -> a -> a
    stimesPeriod2 :: forall a n. (Monoid a, Integral n) => n -> a -> a
    stimesPeriod2 n
    n a
    x
      | n -> Bool
    forall a. Integral a => a -> Bool
    even n
    n    = a
    forall a. Monoid a => a
    mempty
      | Bool
    otherwise = a
    x

    -- | A boolean algebra regarded as a monoid under exclusive or
    newtype XorB b = XorB {
      forall b. XorB b -> b
    getXorB :: b
    } deriving (XorB b -> XorB b -> Bool
    (XorB b -> XorB b -> Bool)
    -> (XorB b -> XorB b -> Bool) -> Eq (XorB b)
    forall b. Eq b => XorB b -> XorB b -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall b. Eq b => XorB b -> XorB b -> Bool
    == :: XorB b -> XorB b -> Bool
    $c/= :: forall b. Eq b => XorB b -> XorB b -> Bool
    /= :: XorB b -> XorB b -> Bool
    Eq, Eq (XorB b)
    Eq (XorB b) =>
    (XorB b -> XorB b -> Ordering)
    -> (XorB b -> XorB b -> Bool)
    -> (XorB b -> XorB b -> Bool)
    -> (XorB b -> XorB b -> Bool)
    -> (XorB b -> XorB b -> Bool)
    -> (XorB b -> XorB b -> XorB b)
    -> (XorB b -> XorB b -> XorB b)
    -> Ord (XorB b)
    XorB b -> XorB b -> Bool
    XorB b -> XorB b -> Ordering
    XorB b -> XorB b -> XorB b
    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 b. Ord b => Eq (XorB b)
    forall b. Ord b => XorB b -> XorB b -> Bool
    forall b. Ord b => XorB b -> XorB b -> Ordering
    forall b. Ord b => XorB b -> XorB b -> XorB b
    $ccompare :: forall b. Ord b => XorB b -> XorB b -> Ordering
    compare :: XorB b -> XorB b -> Ordering
    $c< :: forall b. Ord b => XorB b -> XorB b -> Bool
    < :: XorB b -> XorB b -> Bool
    $c<= :: forall b. Ord b => XorB b -> XorB b -> Bool
    <= :: XorB b -> XorB b -> Bool
    $c> :: forall b. Ord b => XorB b -> XorB b -> Bool
    > :: XorB b -> XorB b -> Bool
    $c>= :: forall b. Ord b => XorB b -> XorB b -> Bool
    >= :: XorB b -> XorB b -> Bool
    $cmax :: forall b. Ord b => XorB b -> XorB b -> XorB b
    max :: XorB b -> XorB b -> XorB b
    $cmin :: forall b. Ord b => XorB b -> XorB b -> XorB b
    min :: XorB b -> XorB b -> XorB b
    Ord, Int -> XorB b -> ShowS
    [XorB b] -> ShowS
    XorB b -> String
    (Int -> XorB b -> ShowS)
    -> (XorB b -> String) -> ([XorB b] -> ShowS) -> Show (XorB b)
    forall b. Show b => Int -> XorB b -> ShowS
    forall b. Show b => [XorB b] -> ShowS
    forall b. Show b => XorB b -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall b. Show b => Int -> XorB b -> ShowS
    showsPrec :: Int -> XorB b -> ShowS
    $cshow :: forall b. Show b => XorB b -> String
    show :: XorB b -> String
    $cshowList :: forall b. Show b => [XorB b] -> ShowS
    showList :: [XorB b] -> ShowS
    Show)

    #if MIN_VERSION_base(4,11,0)
    instance Boolean b => Semigroup (XorB b) where
      XorB b
    x <> :: XorB b -> XorB b -> XorB b
    <> XorB b
    y = b -> XorB b
    forall b. b -> XorB b
    XorB (b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    `xor` b
    y)
      stimes :: forall b. Integral b => b -> XorB b -> XorB b
    stimes = b -> XorB b -> XorB b
    forall a n. (Monoid a, Integral n) => n -> a -> a
    stimesPeriod2

    instance Boolean b => Monoid (XorB b) where
      mempty :: XorB b
    mempty = b -> XorB b
    forall b. b -> XorB b
    XorB b
    forall b. Boolean b => b
    false
    #else
    instance Boolean b => Monoid (XorB b) where
      mappend (XorB x) (XorB y) = XorB (x `xor` y)
      mempty = XorB false
    #endif

    -- | A boolean algebra regarded as a monoid under equivalence
    newtype EquivB b = EquivB {
      forall b. EquivB b -> b
    getEquivB :: b
    }  deriving (EquivB b -> EquivB b -> Bool
    (EquivB b -> EquivB b -> Bool)
    -> (EquivB b -> EquivB b -> Bool) -> Eq (EquivB b)
    forall b. Eq b => EquivB b -> EquivB b -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall b. Eq b => EquivB b -> EquivB b -> Bool
    == :: EquivB b -> EquivB b -> Bool
    $c/= :: forall b. Eq b => EquivB b -> EquivB b -> Bool
    /= :: EquivB b -> EquivB b -> Bool
    Eq, Eq (EquivB b)
    Eq (EquivB b) =>
    (EquivB b -> EquivB b -> Ordering)
    -> (EquivB b -> EquivB b -> Bool)
    -> (EquivB b -> EquivB b -> Bool)
    -> (EquivB b -> EquivB b -> Bool)
    -> (EquivB b -> EquivB b -> Bool)
    -> (EquivB b -> EquivB b -> EquivB b)
    -> (EquivB b -> EquivB b -> EquivB b)
    -> Ord (EquivB b)
    EquivB b -> EquivB b -> Bool
    EquivB b -> EquivB b -> Ordering
    EquivB b -> EquivB b -> EquivB b
    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 b. Ord b => Eq (EquivB b)
    forall b. Ord b => EquivB b -> EquivB b -> Bool
    forall b. Ord b => EquivB b -> EquivB b -> Ordering
    forall b. Ord b => EquivB b -> EquivB b -> EquivB b
    $ccompare :: forall b. Ord b => EquivB b -> EquivB b -> Ordering
    compare :: EquivB b -> EquivB b -> Ordering
    $c< :: forall b. Ord b => EquivB b -> EquivB b -> Bool
    < :: EquivB b -> EquivB b -> Bool
    $c<= :: forall b. Ord b => EquivB b -> EquivB b -> Bool
    <= :: EquivB b -> EquivB b -> Bool
    $c> :: forall b. Ord b => EquivB b -> EquivB b -> Bool
    > :: EquivB b -> EquivB b -> Bool
    $c>= :: forall b. Ord b => EquivB b -> EquivB b -> Bool
    >= :: EquivB b -> EquivB b -> Bool
    $cmax :: forall b. Ord b => EquivB b -> EquivB b -> EquivB b
    max :: EquivB b -> EquivB b -> EquivB b
    $cmin :: forall b. Ord b => EquivB b -> EquivB b -> EquivB b
    min :: EquivB b -> EquivB b -> EquivB b
    Ord, Int -> EquivB b -> ShowS
    [EquivB b] -> ShowS
    EquivB b -> String
    (Int -> EquivB b -> ShowS)
    -> (EquivB b -> String) -> ([EquivB b] -> ShowS) -> Show (EquivB b)
    forall b. Show b => Int -> EquivB b -> ShowS
    forall b. Show b => [EquivB b] -> ShowS
    forall b. Show b => EquivB b -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall b. Show b => Int -> EquivB b -> ShowS
    showsPrec :: Int -> EquivB b -> ShowS
    $cshow :: forall b. Show b => EquivB b -> String
    show :: EquivB b -> String
    $cshowList :: forall b. Show b => [EquivB b] -> ShowS
    showList :: [EquivB b] -> ShowS
    Show)

    #if MIN_VERSION_base(4,11,0)
    instance Boolean b => Semigroup (EquivB b) where
      EquivB b
    x <> :: EquivB b -> EquivB b -> EquivB b
    <> EquivB b
    y = b -> EquivB b
    forall b. b -> EquivB b
    EquivB (b
    x b -> b -> b
    forall b. Boolean b => b -> b -> b
    <--> b
    y)
      stimes :: forall b. Integral b => b -> EquivB b -> EquivB b
    stimes = b -> EquivB b -> EquivB b
    forall a n. (Monoid a, Integral n) => n -> a -> a
    stimesPeriod2

    instance Boolean b => Monoid (EquivB b) where
      mempty :: EquivB b
    mempty = b -> EquivB b
    forall b. b -> EquivB b
    EquivB b
    forall b. Boolean b => b
    true
    #else
    instance Boolean b => Monoid (EquivB b) where
      mappend (EquivB x) (EquivB y) = EquivB (x <--> y)
      mempty = EquivB true
    #endif

    -- |Injection from 'Bool' into a boolean algebra.
    fromBool :: Boolean b => Bool -> b
    fromBool :: forall b. Boolean b => Bool -> b
    fromBool Bool
    b = if Bool
    b then b
    forall b. Boolean b => b
    true else b
    forall b. Boolean b => b
    false

    instance Boolean Bool where
      true :: Bool
    true = Bool
    True
      false :: Bool
    false = Bool
    False
      && :: Bool -> Bool -> Bool
    (&&) = Bool -> Bool -> Bool
    (P.&&)
      || :: Bool -> Bool -> Bool
    (||) = Bool -> Bool -> Bool
    (P.||)
      not :: Bool -> Bool
    not = Bool -> Bool
    P.not
      xor :: Bool -> Bool -> Bool
    xor = Bool -> Bool -> Bool
    forall a. Eq a => a -> a -> Bool
    (/=)
      Bool
    True  --> :: Bool -> Bool -> Bool
    --> Bool
    a = Bool
    a
      Bool
    False --> Bool
    _ = Bool
    True
      <--> :: Bool -> Bool -> Bool
    (<-->) = Bool -> Bool -> Bool
    forall a. Eq a => a -> a -> Bool
    (==)

    -- | Could be done via `deriving via` from GHC8.6.1 onwards
    instance Boolean Any where
      true :: Any
    true                  = Bool -> Any
    Any Bool
    True
      false :: Any
    false                 = Bool -> Any
    Any Bool
    False
      not :: Any -> Any
    not (Any Bool
    p)           = Bool -> Any
    Any (Bool -> Bool
    forall b. Boolean b => b -> b
    not Bool
    p)
      (Any Bool
    p) && :: Any -> Any -> Any
    &&    (Any Bool
    q) = Bool -> Any
    Any (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    && Bool
    q)
      (Any Bool
    p) || :: Any -> Any -> Any
    ||    (Any Bool
    q) = Bool -> Any
    Any (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    || Bool
    q)
      (Any Bool
    p) xor :: Any -> Any -> Any
    `xor` (Any Bool
    q) = Bool -> Any
    Any (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    `xor` Bool
    q)
      (Any Bool
    p) --> :: Any -> Any -> Any
    --> (Any Bool
    q)   = Bool -> Any
    Any (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    --> Bool
    q)
      (Any Bool
    p) <--> :: Any -> Any -> Any
    <--> (Any Bool
    q)  = Bool -> Any
    Any (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    <--> Bool
    q)

    -- | Could be done via `deriving via` from GHC8.6.1 onwards
    instance Boolean All where
      true :: All
    true                  = Bool -> All
    All Bool
    True
      false :: All
    false                 = Bool -> All
    All Bool
    False
      not :: All -> All
    not (All Bool
    p)           = Bool -> All
    All (Bool -> Bool
    forall b. Boolean b => b -> b
    not Bool
    p)
      (All Bool
    p) && :: All -> All -> All
    && (All Bool
    q)    = Bool -> All
    All (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    && Bool
    q)
      (All Bool
    p) || :: All -> All -> All
    || (All Bool
    q)    = Bool -> All
    All (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    || Bool
    q)
      (All Bool
    p) xor :: All -> All -> All
    `xor` (All Bool
    q) = Bool -> All
    All (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    `xor` Bool
    q)
      (All Bool
    p) --> :: All -> All -> All
    --> (All Bool
    q)   = Bool -> All
    All (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    --> Bool
    q)
      (All Bool
    p) <--> :: All -> All -> All
    <--> (All Bool
    q)  = Bool -> All
    All (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    <--> Bool
    q)

    -- | Could be done via `deriving via` from GHC8.6.1 onwards
    instance Boolean (Dual Bool) where
      true :: Dual Bool
    true                    = Bool -> Dual Bool
    forall a. a -> Dual a
    Dual Bool
    True
      false :: Dual Bool
    false                   = Bool -> Dual Bool
    forall a. a -> Dual a
    Dual Bool
    False
      not :: Dual Bool -> Dual Bool
    not (Dual Bool
    p)            = Bool -> Dual Bool
    forall a. a -> Dual a
    Dual (Bool -> Bool
    forall b. Boolean b => b -> b
    not Bool
    p)
      (Dual Bool
    p) && :: Dual Bool -> Dual Bool -> Dual Bool
    && (Dual Bool
    q)    = Bool -> Dual Bool
    forall a. a -> Dual a
    Dual (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    && Bool
    q)
      (Dual Bool
    p) || :: Dual Bool -> Dual Bool -> Dual Bool
    || (Dual Bool
    q)    = Bool -> Dual Bool
    forall a. a -> Dual a
    Dual (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    || Bool
    q)
      (Dual Bool
    p) xor :: Dual Bool -> Dual Bool -> Dual Bool
    `xor` (Dual Bool
    q) = Bool -> Dual Bool
    forall a. a -> Dual a
    Dual (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    `xor` Bool
    q)
      (Dual Bool
    p) --> :: Dual Bool -> Dual Bool -> Dual Bool
    --> (Dual Bool
    q)   = Bool -> Dual Bool
    forall a. a -> Dual a
    Dual (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    --> Bool
    q)
      (Dual Bool
    p) <--> :: Dual Bool -> Dual Bool -> Dual Bool
    <--> (Dual Bool
    q)  = Bool -> Dual Bool
    forall a. a -> Dual a
    Dual (Bool
    p Bool -> Bool -> Bool
    forall b. Boolean b => b -> b -> b
    <--> Bool
    q)

    newtype Opp a = Opp { forall a. Opp a -> a
    getOpp :: a }
      deriving (Opp a -> Opp a -> Bool
    (Opp a -> Opp a -> Bool) -> (Opp a -> Opp a -> Bool) -> Eq (Opp a)
    forall a. Eq a => Opp a -> Opp a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Opp a -> Opp a -> Bool
    == :: Opp a -> Opp a -> Bool
    $c/= :: forall a. Eq a => Opp a -> Opp a -> Bool
    /= :: Opp a -> Opp a -> Bool
    Eq, Eq (Opp a)
    Eq (Opp a) =>
    (Opp a -> Opp a -> Ordering)
    -> (Opp a -> Opp a -> Bool)
    -> (Opp a -> Opp a -> Bool)
    -> (Opp a -> Opp a -> Bool)
    -> (Opp a -> Opp a -> Bool)
    -> (Opp a -> Opp a -> Opp a)
    -> (Opp a -> Opp a -> Opp a)
    -> Ord (Opp a)
    Opp a -> Opp a -> Bool
    Opp a -> Opp a -> Ordering
    Opp a -> Opp a -> Opp a
    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 a. Ord a => Eq (Opp a)
    forall a. Ord a => Opp a -> Opp a -> Bool
    forall a. Ord a => Opp a -> Opp a -> Ordering
    forall a. Ord a => Opp a -> Opp a -> Opp a
    $ccompare :: forall a. Ord a => Opp a -> Opp a -> Ordering
    compare :: Opp a -> Opp a -> Ordering
    $c< :: forall a. Ord a => Opp a -> Opp a -> Bool
    < :: Opp a -> Opp a -> Bool
    $c<= :: forall a. Ord a => Opp a -> Opp a -> Bool
    <= :: Opp a -> Opp a -> Bool
    $c> :: forall a. Ord a => Opp a -> Opp a -> Bool
    > :: Opp a -> Opp a -> Bool
    $c>= :: forall a. Ord a => Opp a -> Opp a -> Bool
    >= :: Opp a -> Opp a -> Bool
    $cmax :: forall a. Ord a => Opp a -> Opp a -> Opp a
    max :: Opp a -> Opp a -> Opp a
    $cmin :: forall a. Ord a => Opp a -> Opp a -> Opp a
    min :: Opp a -> Opp a -> Opp a
    Ord, Int -> Opp a -> ShowS
    [Opp a] -> ShowS
    Opp a -> String
    (Int -> Opp a -> ShowS)
    -> (Opp a -> String) -> ([Opp a] -> ShowS) -> Show (Opp a)
    forall a. Show a => Int -> Opp a -> ShowS
    forall a. Show a => [Opp a] -> ShowS
    forall a. Show a => Opp a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Opp a -> ShowS
    showsPrec :: Int -> Opp a -> ShowS
    $cshow :: forall a. Show a => Opp a -> String
    show :: Opp a -> String
    $cshowList :: forall a. Show a => [Opp a] -> ShowS
    showList :: [Opp a] -> ShowS
    Show)

    -- | Opposite boolean algebra: exchanges true and false, and `and` and
    -- `or`, etc
    instance Boolean a => Boolean (Opp a) where
      true :: Opp a
    true = a -> Opp a
    forall a. a -> Opp a
    Opp a
    forall b. Boolean b => b
    false
      false :: Opp a
    false = a -> Opp a
    forall a. a -> Opp a
    Opp a
    forall b. Boolean b => b
    true
      not :: Opp a -> Opp a
    not = a -> Opp a
    forall a. a -> Opp a
    Opp (a -> Opp a) -> (Opp a -> a) -> Opp a -> Opp a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> a
    forall b. Boolean b => b -> b
    not (a -> a) -> (Opp a -> a) -> Opp a -> a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Opp a -> a
    forall a. Opp a -> a
    getOpp
      && :: Opp a -> Opp a -> Opp a
    (&&) = (a -> Opp a
    forall a. a -> Opp a
    Opp (a -> Opp a) -> (a -> a) -> a -> Opp a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .) ((a -> a) -> a -> Opp a) -> (a -> a -> a) -> a -> a -> Opp a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> a -> a
    forall b. Boolean b => b -> b -> b
    (||) (a -> a -> Opp a) -> (Opp a -> a) -> Opp a -> Opp a -> Opp a
    forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
    `on` Opp a -> a
    forall a. Opp a -> a
    getOpp
      || :: Opp a -> Opp a -> Opp a
    (||) = (a -> Opp a
    forall a. a -> Opp a
    Opp (a -> Opp a) -> (a -> a) -> a -> Opp a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .) ((a -> a) -> a -> Opp a) -> (a -> a -> a) -> a -> a -> Opp a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> a -> a
    forall b. Boolean b => b -> b -> b
    (&&) (a -> a -> Opp a) -> (Opp a -> a) -> Opp a -> Opp a -> Opp a
    forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
    `on` Opp a -> a
    forall a. Opp a -> a
    getOpp
      xor :: Opp a -> Opp a -> Opp a
    xor = (a -> Opp a
    forall a. a -> Opp a
    Opp (a -> Opp a) -> (a -> a) -> a -> Opp a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .) ((a -> a) -> a -> Opp a) -> (a -> a -> a) -> a -> a -> Opp a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> a -> a
    forall b. Boolean b => b -> b -> b
    (<-->) (a -> a -> Opp a) -> (Opp a -> a) -> Opp a -> Opp a -> Opp a
    forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
    `on` Opp a -> a
    forall a. Opp a -> a
    getOpp
      <--> :: Opp a -> Opp a -> Opp a
    (<-->) = (a -> Opp a
    forall a. a -> Opp a
    Opp (a -> Opp a) -> (a -> a) -> a -> Opp a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .) ((a -> a) -> a -> Opp a) -> (a -> a -> a) -> a -> a -> Opp a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> a -> a
    forall b. Boolean b => b -> b -> b
    xor (a -> a -> Opp a) -> (Opp a -> a) -> Opp a -> Opp a -> Opp a
    forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
    `on` Opp a -> a
    forall a. Opp a -> a
    getOpp

    -- | Pointwise boolean algebra.
    --
    instance Boolean b => Boolean (a -> b) where
      true :: a -> b
    true      = b -> a -> b
    forall a b. a -> b -> a
    const b
    forall b. Boolean b => b
    true
      false :: a -> b
    false     = b -> a -> b
    forall a b. a -> b -> a
    const b
    forall b. Boolean b => b
    false
      not :: (a -> b) -> a -> b
    not a -> b
    p     = b -> b
    forall b. Boolean b => b -> b
    not (b -> b) -> (a -> b) -> a -> b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> b
    p
      a -> b
    p && :: (a -> b) -> (a -> b) -> a -> b
    && a -> b
    q    = \a
    a -> a -> b
    p a
    a b -> b -> b
    forall b. Boolean b => b -> b -> b
    && a -> b
    q a
    a
      a -> b
    p || :: (a -> b) -> (a -> b) -> a -> b
    || a -> b
    q    = \a
    a -> a -> b
    p a
    a b -> b -> b
    forall b. Boolean b => b -> b -> b
    || a -> b
    q a
    a
      a -> b
    p xor :: (a -> b) -> (a -> b) -> a -> b
    `xor` a -> b
    q = \a
    a -> a -> b
    p a
    a b -> b -> b
    forall b. Boolean b => b -> b -> b
    `xor` a -> b
    q a
    a
      a -> b
    p --> :: (a -> b) -> (a -> b) -> a -> b
    --> a -> b
    q   = \a
    a -> a -> b
    p a
    a b -> b -> b
    forall b. Boolean b => b -> b -> b
    --> a -> b
    q a
    a
      a -> b
    p <--> :: (a -> b) -> (a -> b) -> a -> b
    <--> a -> b
    q  = \a
    a -> a -> b
    p a
    a b -> b -> b
    forall b. Boolean b => b -> b -> b
    <--> a -> b
    q a
    a

    -- | Could be done via `deriving via` from GHC8.6.1 onwards
    instance Boolean a => Boolean (Endo a) where
      true :: Endo a
    true                    = (a -> a) -> Endo a
    forall a. (a -> a) -> Endo a
    Endo (a -> a -> a
    forall a b. a -> b -> a
    const a
    forall b. Boolean b => b
    true)
      false :: Endo a
    false                   = (a -> a) -> Endo a
    forall a. (a -> a) -> Endo a
    Endo (a -> a -> a
    forall a b. a -> b -> a
    const a
    forall b. Boolean b => b
    false)
      not :: Endo a -> Endo a
    not (Endo a -> a
    p)            = (a -> a) -> Endo a
    forall a. (a -> a) -> Endo a
    Endo (a -> a
    forall b. Boolean b => b -> b
    not (a -> a) -> (a -> a) -> a -> a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> a
    p)
      (Endo a -> a
    p) && :: Endo a -> Endo a -> Endo a
    && (Endo a -> a
    q)    = (a -> a) -> Endo a
    forall a. (a -> a) -> Endo a
    Endo (\a
    a -> a -> a
    p a
    a a -> a -> a
    forall b. Boolean b => b -> b -> b
    && a -> a
    q a
    a)
      (Endo a -> a
    p) || :: Endo a -> Endo a -> Endo a
    || (Endo a -> a
    q)    = (a -> a) -> Endo a
    forall a. (a -> a) -> Endo a
    Endo (\a
    a -> a -> a
    p a
    a a -> a -> a
    forall b. Boolean b => b -> b -> b
    || a -> a
    q a
    a)
      (Endo a -> a
    p) xor :: Endo a -> Endo a -> Endo a
    `xor` (Endo a -> a
    q) = (a -> a) -> Endo a
    forall a. (a -> a) -> Endo a
    Endo (\a
    a -> a -> a
    p a
    a a -> a -> a
    forall b. Boolean b => b -> b -> b
    `xor` a -> a
    q a
    a)
      (Endo a -> a
    p) --> :: Endo a -> Endo a -> Endo a
    --> (Endo a -> a
    q)   = (a -> a) -> Endo a
    forall a. (a -> a) -> Endo a
    Endo (\a
    a -> a -> a
    p a
    a a -> a -> a
    forall b. Boolean b => b -> b -> b
    --> a -> a
    q a
    a)
      (Endo a -> a
    p) <--> :: Endo a -> Endo a -> Endo a
    <--> (Endo a -> a
    q)  = (a -> a) -> Endo a
    forall a. (a -> a) -> Endo a
    Endo (\a
    a -> a -> a
    p a
    a a -> a -> a
    forall b. Boolean b => b -> b -> b
    <--> a -> a
    q a
    a)

    -- |The trivial boolean algebra
    instance Boolean () where
      true :: ()
    true = ()
      false :: ()
    false = ()
      not :: () -> ()
    not ()
    _ = ()
      ()
    _ && :: () -> () -> ()
    && ()
    _ = ()
      ()
    _ || :: () -> () -> ()
    || ()
    _ = ()
      ()
    _ --> :: () -> () -> ()
    --> ()
    _ = ()
      ()
    _ <--> :: () -> () -> ()
    <--> ()
    _ = ()

    instance (Boolean x, Boolean y) => Boolean (x, y) where
      true :: (x, y)
    true                = (x
    forall b. Boolean b => b
    true, y
    forall b. Boolean b => b
    true)
      false :: (x, y)
    false               = (x
    forall b. Boolean b => b
    false, y
    forall b. Boolean b => b
    false)
      not :: (x, y) -> (x, y)
    not (x
    a, y
    b)          = (x -> x
    forall b. Boolean b => b -> b
    not x
    a, y -> y
    forall b. Boolean b => b -> b
    not y
    b)
      (x
    a, y
    b) && :: (x, y) -> (x, y) -> (x, y)
    && (x
    c, y
    d)    = (x
    a x -> x -> x
    forall b. Boolean b => b -> b -> b
    && x
    c, y
    b y -> y -> y
    forall b. Boolean b => b -> b -> b
    && y
    d)
      (x
    a, y
    b) || :: (x, y) -> (x, y) -> (x, y)
    || (x
    c, y
    d)    = (x
    a x -> x -> x
    forall b. Boolean b => b -> b -> b
    || x
    c, y
    b y -> y -> y
    forall b. Boolean b => b -> b -> b
    || y
    d)
      (x
    a, y
    b) xor :: (x, y) -> (x, y) -> (x, y)
    `xor` (x
    c, y
    d) = (x
    a x -> x -> x
    forall b. Boolean b => b -> b -> b
    `xor` x
    c, y
    b y -> y -> y
    forall b. Boolean b => b -> b -> b
    `xor` y
    d)
      (x
    a, y
    b) --> :: (x, y) -> (x, y) -> (x, y)
    --> (x
    c, y
    d)   = (x
    a x -> x -> x
    forall b. Boolean b => b -> b -> b
    --> x
    c, y
    b y -> y -> y
    forall b. Boolean b => b -> b -> b
    --> y
    d)
      (x
    a, y
    b) <--> :: (x, y) -> (x, y) -> (x, y)
    <--> (x
    c, y
    d)  = (x
    a x -> x -> x
    forall b. Boolean b => b -> b -> b
    <--> x
    c, y
    b y -> y -> y
    forall b. Boolean b => b -> b -> b
    <--> y
    d)

    instance (Boolean x, Boolean y, Boolean z) => Boolean (x, y, z) where
      true :: (x, y, z)
    true                      = (x
    forall b. Boolean b => b
    true, y
    forall b. Boolean b => b
    true, z
    forall b. Boolean b => b
    true)
      false :: (x, y, z)
    false                     = (x
    forall b. Boolean b => b
    false, y
    forall b. Boolean b => b
    false, z
    forall b. Boolean b => b
    false)
      not :: (x, y, z) -> (x, y, z)
    not (x
    a, y
    b, z
    c)             = (x -> x
    forall b. Boolean b => b -> b
    not x
    a, y -> y
    forall b. Boolean b => b -> b
    not y
    b, z -> z
    forall b. Boolean b => b -> b
    not z
    c)
      (x
    a, y
    b, z
    c) && :: (x, y, z) -> (x, y, z) -> (x, y, z)
    && (x
    d, y
    e, z
    f)    = (x
    a x -> x -> x
    forall b. Boolean b => b -> b -> b
    && x
    d, y
    b y -> y -> y
    forall b. Boolean b => b -> b -> b
    && y
    e, z
    c z -> z -> z
    forall b. Boolean b => b -> b -> b
    && z
    f)
      (x
    a, y
    b, z
    c) || :: (x, y, z) -> (x, y, z) -> (x, y, z)
    || (x
    d, y
    e, z
    f)    = (x
    a x -> x -> x
    forall b. Boolean b => b -> b -> b
    || x
    d, y
    b y -> y -> y
    forall b. Boolean b => b -> b -> b
    || y
    e, z
    c z -> z -> z
    forall b. Boolean b => b -> b -> b
    || z
    f)
      (x
    a, y
    b, z
    c) xor :: (x, y, z) -> (x, y, z) -> (x, y, z)
    `xor` (x
    d, y
    e, z
    f) = (x
    a x -> x -> x
    forall b. Boolean b => b -> b -> b
    `xor` x
    d, y
    b y -> y -> y
    forall b. Boolean b => b -> b -> b
    `xor` y
    e, z
    c z -> z -> z
    forall b. Boolean b => b -> b -> b
    `xor` z
    f)
      (x
    a, y
    b, z
    c) --> :: (x, y, z) -> (x, y, z) -> (x, y, z)
    --> (x
    d, y
    e, z
    f)   = (x
    a x -> x -> x
    forall b. Boolean b => b -> b -> b
    --> x
    d, y
    b y -> y -> y
    forall b. Boolean b => b -> b -> b
    --> y
    e, z
    c z -> z -> z
    forall b. Boolean b => b -> b -> b
    --> z
    f)
      (x
    a, y
    b, z
    c) <--> :: (x, y, z) -> (x, y, z) -> (x, y, z)
    <--> (x
    d, y
    e, z
    f)  = (x
    a x -> x -> x
    forall b. Boolean b => b -> b -> b
    <--> x
    d, y
    b y -> y -> y
    forall b. Boolean b => b -> b -> b
    <--> y
    e, z
    c z -> z -> z
    forall b. Boolean b => b -> b -> b
    <--> z
    f)

    -- |A newtype wrapper that derives a 'Boolean' instance from any type that is both
    -- a 'Bits' instance and a 'Num' instance,
    -- such that boolean logic operations on the 'Bitwise' wrapper correspond to
    -- bitwise logic operations on the inner type. It should be noted that 'false' is
    -- defined as 'Bitwise' 0 and 'true' is defined as 'not' 'false'.
    --
    -- In addition, a number of other classes are automatically derived from the inner
    -- type. These classes were chosen on the basis that many other 'Bits'
    -- instances defined in base are also instances of these classes.
    newtype Bitwise a = Bitwise {forall a. Bitwise a -> a
    getBits :: a}
                      deriving (Integer -> Bitwise a
    Bitwise a -> Bitwise a
    Bitwise a -> Bitwise a -> Bitwise a
    (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a)
    -> (Integer -> Bitwise a)
    -> Num (Bitwise a)
    forall a. Num a => Integer -> Bitwise a
    forall a. Num a => Bitwise a -> Bitwise a
    forall a. Num a => Bitwise a -> Bitwise a -> Bitwise a
    forall a.
    (a -> a -> a)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> (a -> a)
    -> (a -> a)
    -> (a -> a)
    -> (Integer -> a)
    -> Num a
    $c+ :: forall a. Num a => Bitwise a -> Bitwise a -> Bitwise a
    + :: Bitwise a -> Bitwise a -> Bitwise a
    $c- :: forall a. Num a => Bitwise a -> Bitwise a -> Bitwise a
    - :: Bitwise a -> Bitwise a -> Bitwise a
    $c* :: forall a. Num a => Bitwise a -> Bitwise a -> Bitwise a
    * :: Bitwise a -> Bitwise a -> Bitwise a
    $cnegate :: forall a. Num a => Bitwise a -> Bitwise a
    negate :: Bitwise a -> Bitwise a
    $cabs :: forall a. Num a => Bitwise a -> Bitwise a
    abs :: Bitwise a -> Bitwise a
    $csignum :: forall a. Num a => Bitwise a -> Bitwise a
    signum :: Bitwise a -> Bitwise a
    $cfromInteger :: forall a. Num a => Integer -> Bitwise a
    fromInteger :: Integer -> Bitwise a
    Num, Eq (Bitwise a)
    Bitwise a
    Eq (Bitwise a) =>
    (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a)
    -> (Bitwise a -> Int -> Bitwise a)
    -> (Bitwise a -> Int -> Bitwise a)
    -> Bitwise a
    -> (Int -> Bitwise a)
    -> (Bitwise a -> Int -> Bitwise a)
    -> (Bitwise a -> Int -> Bitwise a)
    -> (Bitwise a -> Int -> Bitwise a)
    -> (Bitwise a -> Int -> Bool)
    -> (Bitwise a -> Maybe Int)
    -> (Bitwise a -> Int)
    -> (Bitwise a -> Bool)
    -> (Bitwise a -> Int -> Bitwise a)
    -> (Bitwise a -> Int -> Bitwise a)
    -> (Bitwise a -> Int -> Bitwise a)
    -> (Bitwise a -> Int -> Bitwise a)
    -> (Bitwise a -> Int -> Bitwise a)
    -> (Bitwise a -> Int -> Bitwise a)
    -> (Bitwise a -> Int)
    -> Bits (Bitwise a)
    Int -> Bitwise a
    Bitwise a -> Bool
    Bitwise a -> Int
    Bitwise a -> Maybe Int
    Bitwise a -> Bitwise a
    Bitwise a -> Int -> Bool
    Bitwise a -> Int -> Bitwise a
    Bitwise a -> Bitwise a -> Bitwise a
    forall a.
    Eq a =>
    (a -> a -> a)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> (a -> a)
    -> (a -> Int -> a)
    -> (a -> Int -> a)
    -> a
    -> (Int -> a)
    -> (a -> Int -> a)
    -> (a -> Int -> a)
    -> (a -> Int -> a)
    -> (a -> Int -> Bool)
    -> (a -> Maybe Int)
    -> (a -> Int)
    -> (a -> Bool)
    -> (a -> Int -> a)
    -> (a -> Int -> a)
    -> (a -> Int -> a)
    -> (a -> Int -> a)
    -> (a -> Int -> a)
    -> (a -> Int -> a)
    -> (a -> Int)
    -> Bits a
    forall a. Bits a => Eq (Bitwise a)
    forall a. Bits a => Bitwise a
    forall a. Bits a => Int -> Bitwise a
    forall a. Bits a => Bitwise a -> Bool
    forall a. Bits a => Bitwise a -> Int
    forall a. Bits a => Bitwise a -> Maybe Int
    forall a. Bits a => Bitwise a -> Bitwise a
    forall a. Bits a => Bitwise a -> Int -> Bool
    forall a. Bits a => Bitwise a -> Int -> Bitwise a
    forall a. Bits a => Bitwise a -> Bitwise a -> Bitwise a
    $c.&. :: forall a. Bits a => Bitwise a -> Bitwise a -> Bitwise a
    .&. :: Bitwise a -> Bitwise a -> Bitwise a
    $c.|. :: forall a. Bits a => Bitwise a -> Bitwise a -> Bitwise a
    .|. :: Bitwise a -> Bitwise a -> Bitwise a
    $cxor :: forall a. Bits a => Bitwise a -> Bitwise a -> Bitwise a
    xor :: Bitwise a -> Bitwise a -> Bitwise a
    $ccomplement :: forall a. Bits a => Bitwise a -> Bitwise a
    complement :: Bitwise a -> Bitwise a
    $cshift :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    shift :: Bitwise a -> Int -> Bitwise a
    $crotate :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    rotate :: Bitwise a -> Int -> Bitwise a
    $czeroBits :: forall a. Bits a => Bitwise a
    zeroBits :: Bitwise a
    $cbit :: forall a. Bits a => Int -> Bitwise a
    bit :: Int -> Bitwise a
    $csetBit :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    setBit :: Bitwise a -> Int -> Bitwise a
    $cclearBit :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    clearBit :: Bitwise a -> Int -> Bitwise a
    $ccomplementBit :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    complementBit :: Bitwise a -> Int -> Bitwise a
    $ctestBit :: forall a. Bits a => Bitwise a -> Int -> Bool
    testBit :: Bitwise a -> Int -> Bool
    $cbitSizeMaybe :: forall a. Bits a => Bitwise a -> Maybe Int
    bitSizeMaybe :: Bitwise a -> Maybe Int
    $cbitSize :: forall a. Bits a => Bitwise a -> Int
    bitSize :: Bitwise a -> Int
    $cisSigned :: forall a. Bits a => Bitwise a -> Bool
    isSigned :: Bitwise a -> Bool
    $cshiftL :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    shiftL :: Bitwise a -> Int -> Bitwise a
    $cunsafeShiftL :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    unsafeShiftL :: Bitwise a -> Int -> Bitwise a
    $cshiftR :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    shiftR :: Bitwise a -> Int -> Bitwise a
    $cunsafeShiftR :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    unsafeShiftR :: Bitwise a -> Int -> Bitwise a
    $crotateL :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    rotateL :: Bitwise a -> Int -> Bitwise a
    $crotateR :: forall a. Bits a => Bitwise a -> Int -> Bitwise a
    rotateR :: Bitwise a -> Int -> Bitwise a
    $cpopCount :: forall a. Bits a => Bitwise a -> Int
    popCount :: Bitwise a -> Int
    Bits, Bitwise a -> Bitwise a -> Bool
    (Bitwise a -> Bitwise a -> Bool)
    -> (Bitwise a -> Bitwise a -> Bool) -> Eq (Bitwise a)
    forall a. Eq a => Bitwise a -> Bitwise a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Bitwise a -> Bitwise a -> Bool
    == :: Bitwise a -> Bitwise a -> Bool
    $c/= :: forall a. Eq a => Bitwise a -> Bitwise a -> Bool
    /= :: Bitwise a -> Bitwise a -> Bool
    Eq, Eq (Bitwise a)
    Eq (Bitwise a) =>
    (Bitwise a -> Bitwise a -> Ordering)
    -> (Bitwise a -> Bitwise a -> Bool)
    -> (Bitwise a -> Bitwise a -> Bool)
    -> (Bitwise a -> Bitwise a -> Bool)
    -> (Bitwise a -> Bitwise a -> Bool)
    -> (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> Bitwise a)
    -> Ord (Bitwise a)
    Bitwise a -> Bitwise a -> Bool
    Bitwise a -> Bitwise a -> Ordering
    Bitwise a -> Bitwise a -> Bitwise a
    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 a. Ord a => Eq (Bitwise a)
    forall a. Ord a => Bitwise a -> Bitwise a -> Bool
    forall a. Ord a => Bitwise a -> Bitwise a -> Ordering
    forall a. Ord a => Bitwise a -> Bitwise a -> Bitwise a
    $ccompare :: forall a. Ord a => Bitwise a -> Bitwise a -> Ordering
    compare :: Bitwise a -> Bitwise a -> Ordering
    $c< :: forall a. Ord a => Bitwise a -> Bitwise a -> Bool
    < :: Bitwise a -> Bitwise a -> Bool
    $c<= :: forall a. Ord a => Bitwise a -> Bitwise a -> Bool
    <= :: Bitwise a -> Bitwise a -> Bool
    $c> :: forall a. Ord a => Bitwise a -> Bitwise a -> Bool
    > :: Bitwise a -> Bitwise a -> Bool
    $c>= :: forall a. Ord a => Bitwise a -> Bitwise a -> Bool
    >= :: Bitwise a -> Bitwise a -> Bool
    $cmax :: forall a. Ord a => Bitwise a -> Bitwise a -> Bitwise a
    max :: Bitwise a -> Bitwise a -> Bitwise a
    $cmin :: forall a. Ord a => Bitwise a -> Bitwise a -> Bitwise a
    min :: Bitwise a -> Bitwise a -> Bitwise a
    Ord, Bitwise a
    Bitwise a -> Bitwise a -> Bounded (Bitwise a)
    forall a. a -> a -> Bounded a
    forall a. Bounded a => Bitwise a
    $cminBound :: forall a. Bounded a => Bitwise a
    minBound :: Bitwise a
    $cmaxBound :: forall a. Bounded a => Bitwise a
    maxBound :: Bitwise a
    Bounded, Int -> Bitwise a
    Bitwise a -> Int
    Bitwise a -> [Bitwise a]
    Bitwise a -> Bitwise a
    Bitwise a -> Bitwise a -> [Bitwise a]
    Bitwise a -> Bitwise a -> Bitwise a -> [Bitwise a]
    (Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a)
    -> (Int -> Bitwise a)
    -> (Bitwise a -> Int)
    -> (Bitwise a -> [Bitwise a])
    -> (Bitwise a -> Bitwise a -> [Bitwise a])
    -> (Bitwise a -> Bitwise a -> [Bitwise a])
    -> (Bitwise a -> Bitwise a -> Bitwise a -> [Bitwise a])
    -> Enum (Bitwise a)
    forall a. Enum a => Int -> Bitwise a
    forall a. Enum a => Bitwise a -> Int
    forall a. Enum a => Bitwise a -> [Bitwise a]
    forall a. Enum a => Bitwise a -> Bitwise a
    forall a. Enum a => Bitwise a -> Bitwise a -> [Bitwise a]
    forall a.
    Enum a =>
    Bitwise a -> Bitwise a -> Bitwise a -> [Bitwise a]
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    $csucc :: forall a. Enum a => Bitwise a -> Bitwise a
    succ :: Bitwise a -> Bitwise a
    $cpred :: forall a. Enum a => Bitwise a -> Bitwise a
    pred :: Bitwise a -> Bitwise a
    $ctoEnum :: forall a. Enum a => Int -> Bitwise a
    toEnum :: Int -> Bitwise a
    $cfromEnum :: forall a. Enum a => Bitwise a -> Int
    fromEnum :: Bitwise a -> Int
    $cenumFrom :: forall a. Enum a => Bitwise a -> [Bitwise a]
    enumFrom :: Bitwise a -> [Bitwise a]
    $cenumFromThen :: forall a. Enum a => Bitwise a -> Bitwise a -> [Bitwise a]
    enumFromThen :: Bitwise a -> Bitwise a -> [Bitwise a]
    $cenumFromTo :: forall a. Enum a => Bitwise a -> Bitwise a -> [Bitwise a]
    enumFromTo :: Bitwise a -> Bitwise a -> [Bitwise a]
    $cenumFromThenTo :: forall a.
    Enum a =>
    Bitwise a -> Bitwise a -> Bitwise a -> [Bitwise a]
    enumFromThenTo :: Bitwise a -> Bitwise a -> Bitwise a -> [Bitwise a]
    Enum, Int -> Bitwise a -> ShowS
    [Bitwise a] -> ShowS
    Bitwise a -> String
    (Int -> Bitwise a -> ShowS)
    -> (Bitwise a -> String)
    -> ([Bitwise a] -> ShowS)
    -> Show (Bitwise a)
    forall a. Show a => Int -> Bitwise a -> ShowS
    forall a. Show a => [Bitwise a] -> ShowS
    forall a. Show a => Bitwise a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Bitwise a -> ShowS
    showsPrec :: Int -> Bitwise a -> ShowS
    $cshow :: forall a. Show a => Bitwise a -> String
    show :: Bitwise a -> String
    $cshowList :: forall a. Show a => [Bitwise a] -> ShowS
    showList :: [Bitwise a] -> ShowS
    Show, ReadPrec [Bitwise a]
    ReadPrec (Bitwise a)
    Int -> ReadS (Bitwise a)
    ReadS [Bitwise a]
    (Int -> ReadS (Bitwise a))
    -> ReadS [Bitwise a]
    -> ReadPrec (Bitwise a)
    -> ReadPrec [Bitwise a]
    -> Read (Bitwise a)
    forall a. Read a => ReadPrec [Bitwise a]
    forall a. Read a => ReadPrec (Bitwise a)
    forall a. Read a => Int -> ReadS (Bitwise a)
    forall a. Read a => ReadS [Bitwise a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Bitwise a)
    readsPrec :: Int -> ReadS (Bitwise a)
    $creadList :: forall a. Read a => ReadS [Bitwise a]
    readList :: ReadS [Bitwise a]
    $creadPrec :: forall a. Read a => ReadPrec (Bitwise a)
    readPrec :: ReadPrec (Bitwise a)
    $creadListPrec :: forall a. Read a => ReadPrec [Bitwise a]
    readListPrec :: ReadPrec [Bitwise a]
    Read, Num (Bitwise a)
    Ord (Bitwise a)
    (Num (Bitwise a), Ord (Bitwise a)) =>
    (Bitwise a -> Rational) -> Real (Bitwise a)
    Bitwise a -> Rational
    forall a. (Num a, Ord a) => (a -> Rational) -> Real a
    forall a. Real a => Num (Bitwise a)
    forall a. Real a => Ord (Bitwise a)
    forall a. Real a => Bitwise a -> Rational
    $ctoRational :: forall a. Real a => Bitwise a -> Rational
    toRational :: Bitwise a -> Rational
    Real,
                                Enum (Bitwise a)
    Real (Bitwise a)
    (Real (Bitwise a), Enum (Bitwise a)) =>
    (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> (Bitwise a, Bitwise a))
    -> (Bitwise a -> Bitwise a -> (Bitwise a, Bitwise a))
    -> (Bitwise a -> Integer)
    -> Integral (Bitwise a)
    Bitwise a -> Integer
    Bitwise a -> Bitwise a -> (Bitwise a, Bitwise a)
    Bitwise a -> Bitwise a -> Bitwise a
    forall a. Integral a => Enum (Bitwise a)
    forall a. Integral a => Real (Bitwise a)
    forall a. Integral a => Bitwise a -> Integer
    forall a.
    Integral a =>
    Bitwise a -> Bitwise a -> (Bitwise a, Bitwise a)
    forall a. Integral a => Bitwise a -> Bitwise a -> Bitwise a
    forall a.
    (Real a, Enum a) =>
    (a -> a -> a)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> (a -> a -> (a, a))
    -> (a -> a -> (a, a))
    -> (a -> Integer)
    -> Integral a
    $cquot :: forall a. Integral a => Bitwise a -> Bitwise a -> Bitwise a
    quot :: Bitwise a -> Bitwise a -> Bitwise a
    $crem :: forall a. Integral a => Bitwise a -> Bitwise a -> Bitwise a
    rem :: Bitwise a -> Bitwise a -> Bitwise a
    $cdiv :: forall a. Integral a => Bitwise a -> Bitwise a -> Bitwise a
    div :: Bitwise a -> Bitwise a -> Bitwise a
    $cmod :: forall a. Integral a => Bitwise a -> Bitwise a -> Bitwise a
    mod :: Bitwise a -> Bitwise a -> Bitwise a
    $cquotRem :: forall a.
    Integral a =>
    Bitwise a -> Bitwise a -> (Bitwise a, Bitwise a)
    quotRem :: Bitwise a -> Bitwise a -> (Bitwise a, Bitwise a)
    $cdivMod :: forall a.
    Integral a =>
    Bitwise a -> Bitwise a -> (Bitwise a, Bitwise a)
    divMod :: Bitwise a -> Bitwise a -> (Bitwise a, Bitwise a)
    $ctoInteger :: forall a. Integral a => Bitwise a -> Integer
    toInteger :: Bitwise a -> Integer
    Integral, Typeable, Typeable (Bitwise a)
    Typeable (Bitwise a) =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> Bitwise a -> c (Bitwise a))
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c (Bitwise a))
    -> (Bitwise a -> Constr)
    -> (Bitwise a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c (Bitwise a)))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c (Bitwise a)))
    -> ((forall b. Data b => b -> b) -> Bitwise a -> Bitwise a)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> Bitwise a -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> Bitwise a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a))
    -> Data (Bitwise a)
    Bitwise a -> Constr
    Bitwise a -> DataType
    (forall b. Data b => b -> b) -> Bitwise a -> Bitwise a
    forall a. Data a => Typeable (Bitwise a)
    forall a. Data a => Bitwise a -> Constr
    forall a. Data a => Bitwise a -> DataType
    forall a.
    Data a =>
    (forall b. Data b => b -> b) -> Bitwise a -> Bitwise a
    forall a u.
    Data a =>
    Int -> (forall d. Data d => d -> u) -> Bitwise a -> u
    forall a u.
    Data a =>
    (forall d. Data d => d -> u) -> Bitwise a -> [u]
    forall a r r'.
    Data a =>
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r
    forall a r r'.
    Data a =>
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r
    forall a (m :: * -> *).
    (Data a, Monad m) =>
    (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a)
    forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a)
    forall a (c :: * -> *).
    Data a =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Bitwise a)
    forall a (c :: * -> *).
    Data a =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Bitwise a -> c (Bitwise a)
    forall a (t :: * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (Bitwise a))
    forall a (t :: * -> * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Bitwise 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) -> Bitwise a -> u
    forall u. (forall d. Data d => d -> u) -> Bitwise a -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a)
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a)
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Bitwise a)
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Bitwise a -> c (Bitwise a)
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Bitwise a))
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Bitwise a))
    $cgfoldl :: forall a (c :: * -> *).
    Data a =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Bitwise a -> c (Bitwise a)
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Bitwise a -> c (Bitwise a)
    $cgunfold :: forall a (c :: * -> *).
    Data a =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Bitwise a)
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Bitwise a)
    $ctoConstr :: forall a. Data a => Bitwise a -> Constr
    toConstr :: Bitwise a -> Constr
    $cdataTypeOf :: forall a. Data a => Bitwise a -> DataType
    dataTypeOf :: Bitwise a -> DataType
    $cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (Bitwise a))
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Bitwise a))
    $cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Bitwise a))
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Bitwise a))
    $cgmapT :: forall a.
    Data a =>
    (forall b. Data b => b -> b) -> Bitwise a -> Bitwise a
    gmapT :: (forall b. Data b => b -> b) -> Bitwise a -> Bitwise a
    $cgmapQl :: forall a r r'.
    Data a =>
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r
    $cgmapQr :: forall a r r'.
    Data a =>
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r
    $cgmapQ :: forall a u.
    Data a =>
    (forall d. Data d => d -> u) -> Bitwise a -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> Bitwise a -> [u]
    $cgmapQi :: forall a u.
    Data a =>
    Int -> (forall d. Data d => d -> u) -> Bitwise a -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Bitwise a -> u
    $cgmapM :: forall a (m :: * -> *).
    (Data a, Monad m) =>
    (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a)
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a)
    $cgmapMp :: forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a)
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a)
    $cgmapMo :: forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a)
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a)
    Data, Ord (Bitwise a)
    Ord (Bitwise a) =>
    ((Bitwise a, Bitwise a) -> [Bitwise a])
    -> ((Bitwise a, Bitwise a) -> Bitwise a -> Int)
    -> ((Bitwise a, Bitwise a) -> Bitwise a -> Int)
    -> ((Bitwise a, Bitwise a) -> Bitwise a -> Bool)
    -> ((Bitwise a, Bitwise a) -> Int)
    -> ((Bitwise a, Bitwise a) -> Int)
    -> Ix (Bitwise a)
    (Bitwise a, Bitwise a) -> Int
    (Bitwise a, Bitwise a) -> [Bitwise a]
    (Bitwise a, Bitwise a) -> Bitwise a -> Bool
    (Bitwise a, Bitwise a) -> Bitwise a -> Int
    forall a.
    Ord a =>
    ((a, a) -> [a])
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Bool)
    -> ((a, a) -> Int)
    -> ((a, a) -> Int)
    -> Ix a
    forall a. Ix a => Ord (Bitwise a)
    forall a. Ix a => (Bitwise a, Bitwise a) -> Int
    forall a. Ix a => (Bitwise a, Bitwise a) -> [Bitwise a]
    forall a. Ix a => (Bitwise a, Bitwise a) -> Bitwise a -> Bool
    forall a. Ix a => (Bitwise a, Bitwise a) -> Bitwise a -> Int
    $crange :: forall a. Ix a => (Bitwise a, Bitwise a) -> [Bitwise a]
    range :: (Bitwise a, Bitwise a) -> [Bitwise a]
    $cindex :: forall a. Ix a => (Bitwise a, Bitwise a) -> Bitwise a -> Int
    index :: (Bitwise a, Bitwise a) -> Bitwise a -> Int
    $cunsafeIndex :: forall a. Ix a => (Bitwise a, Bitwise a) -> Bitwise a -> Int
    unsafeIndex :: (Bitwise a, Bitwise a) -> Bitwise a -> Int
    $cinRange :: forall a. Ix a => (Bitwise a, Bitwise a) -> Bitwise a -> Bool
    inRange :: (Bitwise a, Bitwise a) -> Bitwise a -> Bool
    $crangeSize :: forall a. Ix a => (Bitwise a, Bitwise a) -> Int
    rangeSize :: (Bitwise a, Bitwise a) -> Int
    $cunsafeRangeSize :: forall a. Ix a => (Bitwise a, Bitwise a) -> Int
    unsafeRangeSize :: (Bitwise a, Bitwise a) -> Int
    Ix, Ptr (Bitwise a) -> IO (Bitwise a)
    Ptr (Bitwise a) -> Int -> IO (Bitwise a)
    Ptr (Bitwise a) -> Int -> Bitwise a -> IO ()
    Ptr (Bitwise a) -> Bitwise a -> IO ()
    Bitwise a -> Int
    (Bitwise a -> Int)
    -> (Bitwise a -> Int)
    -> (Ptr (Bitwise a) -> Int -> IO (Bitwise a))
    -> (Ptr (Bitwise a) -> Int -> Bitwise a -> IO ())
    -> (forall b. Ptr b -> Int -> IO (Bitwise a))
    -> (forall b. Ptr b -> Int -> Bitwise a -> IO ())
    -> (Ptr (Bitwise a) -> IO (Bitwise a))
    -> (Ptr (Bitwise a) -> Bitwise a -> IO ())
    -> Storable (Bitwise a)
    forall b. Ptr b -> Int -> IO (Bitwise a)
    forall b. Ptr b -> Int -> Bitwise a -> IO ()
    forall a. Storable a => Ptr (Bitwise a) -> IO (Bitwise a)
    forall a. Storable a => Ptr (Bitwise a) -> Int -> IO (Bitwise a)
    forall a.
    Storable a =>
    Ptr (Bitwise a) -> Int -> Bitwise a -> IO ()
    forall a. Storable a => Ptr (Bitwise a) -> Bitwise a -> IO ()
    forall a. Storable a => Bitwise a -> Int
    forall a b. Storable a => Ptr b -> Int -> IO (Bitwise a)
    forall a b. Storable a => Ptr b -> Int -> Bitwise a -> IO ()
    forall a.
    (a -> Int)
    -> (a -> Int)
    -> (Ptr a -> Int -> IO a)
    -> (Ptr a -> Int -> a -> IO ())
    -> (forall b. Ptr b -> Int -> IO a)
    -> (forall b. Ptr b -> Int -> a -> IO ())
    -> (Ptr a -> IO a)
    -> (Ptr a -> a -> IO ())
    -> Storable a
    $csizeOf :: forall a. Storable a => Bitwise a -> Int
    sizeOf :: Bitwise a -> Int
    $calignment :: forall a. Storable a => Bitwise a -> Int
    alignment :: Bitwise a -> Int
    $cpeekElemOff :: forall a. Storable a => Ptr (Bitwise a) -> Int -> IO (Bitwise a)
    peekElemOff :: Ptr (Bitwise a) -> Int -> IO (Bitwise a)
    $cpokeElemOff :: forall a.
    Storable a =>
    Ptr (Bitwise a) -> Int -> Bitwise a -> IO ()
    pokeElemOff :: Ptr (Bitwise a) -> Int -> Bitwise a -> IO ()
    $cpeekByteOff :: forall a b. Storable a => Ptr b -> Int -> IO (Bitwise a)
    peekByteOff :: forall b. Ptr b -> Int -> IO (Bitwise a)
    $cpokeByteOff :: forall a b. Storable a => Ptr b -> Int -> Bitwise a -> IO ()
    pokeByteOff :: forall b. Ptr b -> Int -> Bitwise a -> IO ()
    $cpeek :: forall a. Storable a => Ptr (Bitwise a) -> IO (Bitwise a)
    peek :: Ptr (Bitwise a) -> IO (Bitwise a)
    $cpoke :: forall a. Storable a => Ptr (Bitwise a) -> Bitwise a -> IO ()
    poke :: Ptr (Bitwise a) -> Bitwise a -> IO ()
    Storable, Bitwise a -> ModifierParser
    Bitwise a -> FieldFormatter
    (Bitwise a -> FieldFormatter)
    -> (Bitwise a -> ModifierParser) -> PrintfArg (Bitwise a)
    forall a. PrintfArg a => Bitwise a -> ModifierParser
    forall a. PrintfArg a => Bitwise a -> FieldFormatter
    forall a.
    (a -> FieldFormatter) -> (a -> ModifierParser) -> PrintfArg a
    $cformatArg :: forall a. PrintfArg a => Bitwise a -> FieldFormatter
    formatArg :: Bitwise a -> FieldFormatter
    $cparseFormat :: forall a. PrintfArg a => Bitwise a -> ModifierParser
    parseFormat :: Bitwise a -> ModifierParser
    PrintfArg)

    instance (Num a, Bits a) => Boolean (Bitwise a) where
      true :: Bitwise a
    true   = Bitwise a -> Bitwise a
    forall b. Boolean b => b -> b
    not Bitwise a
    forall b. Boolean b => b
    false
      false :: Bitwise a
    false  = a -> Bitwise a
    forall a. a -> Bitwise a
    Bitwise a
    0
      not :: Bitwise a -> Bitwise a
    not    = a -> Bitwise a
    forall a. a -> Bitwise a
    Bitwise (a -> Bitwise a) -> (Bitwise a -> a) -> Bitwise a -> Bitwise a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> a
    forall a. Bits a => a -> a
    complement (a -> a) -> (Bitwise a -> a) -> Bitwise a -> a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Bitwise a -> a
    forall a. Bitwise a -> a
    getBits
      && :: Bitwise a -> Bitwise a -> Bitwise a
    (&&)   = (a -> Bitwise a
    forall a. a -> Bitwise a
    Bitwise (a -> Bitwise a) -> (a -> a) -> a -> Bitwise a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .) ((a -> a) -> a -> Bitwise a)
    -> (a -> a -> a) -> a -> a -> Bitwise a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> a -> a
    forall a. Bits a => a -> a -> a
    (.&.) (a -> a -> Bitwise a)
    -> (Bitwise a -> a) -> Bitwise a -> Bitwise a -> Bitwise a
    forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
    `on` Bitwise a -> a
    forall a. Bitwise a -> a
    getBits
      || :: Bitwise a -> Bitwise a -> Bitwise a
    (||)   = (a -> Bitwise a
    forall a. a -> Bitwise a
    Bitwise (a -> Bitwise a) -> (a -> a) -> a -> Bitwise a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .) ((a -> a) -> a -> Bitwise a)
    -> (a -> a -> a) -> a -> a -> Bitwise a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> a -> a
    forall a. Bits a => a -> a -> a
    (.|.) (a -> a -> Bitwise a)
    -> (Bitwise a -> a) -> Bitwise a -> Bitwise a -> Bitwise a
    forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
    `on` Bitwise a -> a
    forall a. Bitwise a -> a
    getBits
      xor :: Bitwise a -> Bitwise a -> Bitwise a
    xor    = (a -> Bitwise a
    forall a. a -> Bitwise a
    Bitwise (a -> Bitwise a) -> (Bitwise a -> a) -> Bitwise a -> Bitwise a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .) ((Bitwise a -> a) -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> a)
    -> Bitwise a
    -> Bitwise a
    -> Bitwise a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (a -> a -> a
    forall a. Bits a => a -> a -> a
    Bits.xor (a -> a -> a) -> (Bitwise a -> a) -> Bitwise a -> Bitwise a -> a
    forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
    `on` Bitwise a -> a
    forall a. Bitwise a -> a
    getBits)
      <--> :: Bitwise a -> Bitwise a -> Bitwise a
    (<-->) = (Bitwise a -> Bitwise a
    forall b. Boolean b => b -> b
    not (Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a) -> Bitwise a -> Bitwise a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    .) ((Bitwise a -> Bitwise a) -> Bitwise a -> Bitwise a)
    -> (Bitwise a -> Bitwise a -> Bitwise a)
    -> Bitwise a
    -> Bitwise a
    -> Bitwise a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Bitwise a -> Bitwise a -> Bitwise a
    forall b. Boolean b => b -> b -> b
    xor