cond-0.5.1: Basic conditional and boolean operators with monadic variants.

Safe Haskell | None
Language | Haskell2010

Data.Algebra.Boolean

Synopsis

- class Boolean b where
  - true :: b
  - false :: b
  - not :: b -> b
  - (&&) :: b -> b -> b
  - (||) :: b -> b -> b
  - xor :: b -> b -> b
  - (-->) :: b -> b -> b
  - (<-->) :: b -> b -> b
- fromBool :: Boolean b => Bool -> b
- newtype Bitwise a = Bitwise {
  - getBits :: a
  }
- and :: (Boolean b, Foldable t) => t b -> b
- or :: (Boolean b, Foldable t) => t b -> b
- nand :: (Boolean b, Foldable t) => t b -> b
- nor :: (Boolean b, Foldable t) => t b -> b
- any :: (Boolean b, Foldable t) => (a -> b) -> t a -> b
- all :: (Boolean b, Foldable t) => (a -> b) -> t a -> b
- newtype Opp a = Opp {
  - getOpp :: a
  }
- newtype AnyB b = AnyB {
  - getAnyB :: b
  }
- newtype AllB b = AllB {
  - getAllB :: b
  }
- newtype XorB b = XorB {
  - getXorB :: b
  }
- newtype EquivB b = EquivB {
  - getEquivB :: b
  }

# Documentation

class Boolean b where Source #

A class for boolean algebras. Instances of this class are expected to obey all the laws of boolean algebra).

Minimal complete definition: `true` or `false`, `not` or (`<-->`, `false`), `||` or `&&`.

Minimal complete definition

(false | true), (not | (<-->), false), ((||) | (&&))

Methods

true :: b Source #

Truth value, defined as the top of the bounded lattice

false :: b Source #

False value, defined as the bottom of the bounded lattice.

not :: b -> b Source #

Logical negation.

(&&) :: b -> b -> b infixr 3 Source #

Logical conjunction. (infixr 3)

(||) :: b -> b -> b infixr 2 Source #

Logical inclusive disjunction. (infixr 2)

xor :: b -> b -> b infixr 1 Source #

Logical exclusive disjunction. (infixr 1)

(-->) :: b -> b -> b infixr 1 Source #

Logical implication. (infixr 1)

(<-->) :: b -> b -> b infixr 1 Source #

Logical biconditional. (infixr 1)

#### Instances

Instances details

Boolean All Source # | Could be done via `deriving via` from GHC8.6.1 onwards
Instance details Defined in Data.Algebra.Boolean Methods true :: All Source # false :: All Source # not :: All -> All Source # (&&) :: All -> All -> All Source # (||) :: All -> All -> All Source # xor :: All -> All -> All Source # (-->) :: All -> All -> All Source # (<-->) :: All -> All -> All Source #
Boolean Any Source # | Could be done via `deriving via` from GHC8.6.1 onwards
Instance details Defined in Data.Algebra.Boolean Methods true :: Any Source # false :: Any Source # not :: Any -> Any Source # (&&) :: Any -> Any -> Any Source # (||) :: Any -> Any -> Any Source # xor :: Any -> Any -> Any Source # (-->) :: Any -> Any -> Any Source # (<-->) :: Any -> Any -> Any Source #
Boolean () Source # | The trivial boolean algebra
Instance details Defined in Data.Algebra.Boolean Methods true :: () Source # false :: () Source # not :: () -> () Source # (&&) :: () -> () -> () Source # (||) :: () -> () -> () Source # xor :: () -> () -> () Source # (-->) :: () -> () -> () Source # (<-->) :: () -> () -> () Source #
Boolean Bool Source # |
Instance details Defined in Data.Algebra.Boolean Methods true :: Bool Source # false :: Bool Source # not :: Bool -> Bool Source # (&&) :: Bool -> Bool -> Bool Source # (||) :: Bool -> Bool -> Bool Source # xor :: Bool -> Bool -> Bool Source # (-->) :: Bool -> Bool -> Bool Source # (<-->) :: Bool -> Bool -> Bool Source #
(Num a, Bits a) => Boolean (Bitwise a) Source # |

Instance details

Defined in Data.Algebra.Boolean

Methods

true :: Bitwise a Source #

false :: Bitwise a Source #

not :: Bitwise a -> Bitwise a Source #

(&&) :: Bitwise a -> Bitwise a -> Bitwise a Source #

(||) :: Bitwise a -> Bitwise a -> Bitwise a Source #

xor :: Bitwise a -> Bitwise a -> Bitwise a Source #

(-->) :: Bitwise a -> Bitwise a -> Bitwise a Source #

(<-->) :: Bitwise a -> Bitwise a -> Bitwise a Source #

Boolean a => Boolean (Opp a) Source # | Opposite boolean algebra: exchanges true and false, and `and` and `or`, etc
Instance details Defined in Data.Algebra.Boolean Methods true :: Opp a Source # false :: Opp a Source # not :: Opp a -> Opp a Source # (&&) :: Opp a -> Opp a -> Opp a Source # (||) :: Opp a -> Opp a -> Opp a Source # xor :: Opp a -> Opp a -> Opp a Source # (-->) :: Opp a -> Opp a -> Opp a Source # (<-->) :: Opp a -> Opp a -> Opp a Source #
Boolean (Dual Bool) Source # | Could be done via `deriving via` from GHC8.6.1 onwards

Instance details

Defined in Data.Algebra.Boolean

Methods

true :: Dual Bool Source #

false :: Dual Bool Source #

not :: Dual Bool -> Dual Bool Source #

(&&) :: Dual Bool -> Dual Bool -> Dual Bool Source #

(||) :: Dual Bool -> Dual Bool -> Dual Bool Source #

xor :: Dual Bool -> Dual Bool -> Dual Bool Source #

(-->) :: Dual Bool -> Dual Bool -> Dual Bool Source #

(<-->) :: Dual Bool -> Dual Bool -> Dual Bool Source #

Boolean a => Boolean (Endo a) Source # | Could be done via `deriving via` from GHC8.6.1 onwards
Instance details Defined in Data.Algebra.Boolean Methods true :: Endo a Source # false :: Endo a Source # not :: Endo a -> Endo a Source # (&&) :: Endo a -> Endo a -> Endo a Source # (||) :: Endo a -> Endo a -> Endo a Source # xor :: Endo a -> Endo a -> Endo a Source # (-->) :: Endo a -> Endo a -> Endo a Source # (<-->) :: Endo a -> Endo a -> Endo a Source #
(Boolean x, Boolean y) => Boolean (x, y) Source # |
Instance details Defined in Data.Algebra.Boolean Methods true :: (x, y) Source # false :: (x, y) Source # not :: (x, y) -> (x, y) Source # (&&) :: (x, y) -> (x, y) -> (x, y) Source # (||) :: (x, y) -> (x, y) -> (x, y) Source # xor :: (x, y) -> (x, y) -> (x, y) Source # (-->) :: (x, y) -> (x, y) -> (x, y) Source # (<-->) :: (x, y) -> (x, y) -> (x, y) Source #
Boolean b => Boolean (a -> b) Source # | Pointwise boolean algebra.
Instance details Defined in Data.Algebra.Boolean Methods true :: a -> b Source # false :: a -> b Source # not :: (a -> b) -> a -> b Source # (&&) :: (a -> b) -> (a -> b) -> a -> b Source # (||) :: (a -> b) -> (a -> b) -> a -> b Source # xor :: (a -> b) -> (a -> b) -> a -> b Source # (-->) :: (a -> b) -> (a -> b) -> a -> b Source # (<-->) :: (a -> b) -> (a -> b) -> a -> b Source #
(Boolean x, Boolean y, Boolean z) => Boolean (x, y, z) Source # |

Instance details

Defined in Data.Algebra.Boolean

Methods

true :: (x, y, z) Source #

false :: (x, y, z) Source #

not :: (x, y, z) -> (x, y, z) Source #

(&&) :: (x, y, z) -> (x, y, z) -> (x, y, z) Source #

(||) :: (x, y, z) -> (x, y, z) -> (x, y, z) Source #

xor :: (x, y, z) -> (x, y, z) -> (x, y, z) Source #

(-->) :: (x, y, z) -> (x, y, z) -> (x, y, z) Source #

(<-->) :: (x, y, z) -> (x, y, z) -> (x, y, z) Source #

fromBool :: Boolean b => Bool -> b Source #

Injection from `Bool` into a boolean algebra.

newtype Bitwise a Source #

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.

Constructors

Bitwise |

Fields

- getBits :: a

#### Instances

Instances details

PrintfArg a => PrintfArg (Bitwise a) Source # |
Instance details Defined in Data.Algebra.Boolean Methods formatArg :: Bitwise a -> FieldFormatter Source # parseFormat :: Bitwise a -> ModifierParser Source #
(Num a, Bits a) => Boolean (Bitwise a) Source # |

Instance details

Defined in Data.Algebra.Boolean

Methods

true :: Bitwise a Source #

false :: Bitwise a Source #

not :: Bitwise a -> Bitwise a Source #

(&&) :: Bitwise a -> Bitwise a -> Bitwise a Source #

(||) :: Bitwise a -> Bitwise a -> Bitwise a Source #

xor :: Bitwise a -> Bitwise a -> Bitwise a Source #

(-->) :: Bitwise a -> Bitwise a -> Bitwise a Source #

(<-->) :: Bitwise a -> Bitwise a -> Bitwise a Source #

Bits a => Bits (Bitwise a) Source # |

Instance details

Defined in Data.Algebra.Boolean

Methods

(.&.) :: Bitwise a -> Bitwise a -> Bitwise a Source #

(.|.) :: Bitwise a -> Bitwise a -> Bitwise a Source #

xor :: Bitwise a -> Bitwise a -> Bitwise a Source #

complement :: Bitwise a -> Bitwise a Source #

shift :: Bitwise a -> Int -> Bitwise a Source #

rotate :: Bitwise a -> Int -> Bitwise a Source #

zeroBits :: Bitwise a Source #

bit :: Int -> Bitwise a Source #

setBit :: Bitwise a -> Int -> Bitwise a Source #

clearBit :: Bitwise a -> Int -> Bitwise a Source #

complementBit :: Bitwise a -> Int -> Bitwise a Source #

testBit :: Bitwise a -> Int -> Bool Source #

bitSizeMaybe :: Bitwise a -> Maybe Int Source #

bitSize :: Bitwise a -> Int Source #

isSigned :: Bitwise a -> Bool Source #

shiftL :: Bitwise a -> Int -> Bitwise a Source #

unsafeShiftL :: Bitwise a -> Int -> Bitwise a Source #

shiftR :: Bitwise a -> Int -> Bitwise a Source #

unsafeShiftR :: Bitwise a -> Int -> Bitwise a Source #

rotateL :: Bitwise a -> Int -> Bitwise a Source #

rotateR :: Bitwise a -> Int -> Bitwise a Source #

popCount :: Bitwise a -> Int Source #

Data a => Data (Bitwise a) Source # |

Instance details

Defined in Data.Algebra.Boolean

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bitwise a -> c (Bitwise a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Bitwise a) Source #

toConstr :: Bitwise a -> Constr Source #

dataTypeOf :: Bitwise a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Bitwise a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Bitwise a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Bitwise a -> Bitwise a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bitwise a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Bitwise a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Bitwise a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bitwise a -> m (Bitwise a) Source #

Bounded a => Bounded (Bitwise a) Source # |
Instance details Defined in Data.Algebra.Boolean Methods minBound :: Bitwise a Source # maxBound :: Bitwise a Source #
Enum a => Enum (Bitwise a) Source # |

Instance details

Defined in Data.Algebra.Boolean

Methods

succ :: Bitwise a -> Bitwise a Source #

pred :: Bitwise a -> Bitwise a Source #

toEnum :: Int -> Bitwise a Source #

fromEnum :: Bitwise a -> Int Source #

enumFrom :: Bitwise a -> [Bitwise a] Source #

enumFromThen :: Bitwise a -> Bitwise a -> [Bitwise a] Source #

enumFromTo :: Bitwise a -> Bitwise a -> [Bitwise a] Source #

enumFromThenTo :: Bitwise a -> Bitwise a -> Bitwise a -> [Bitwise a] Source #

Storable a => Storable (Bitwise a) Source # |

Instance details

Defined in Data.Algebra.Boolean

Methods

sizeOf :: Bitwise a -> Int Source #

alignment :: Bitwise a -> Int Source #

peekElemOff :: Ptr (Bitwise a) -> Int -> IO (Bitwise a) Source #

pokeElemOff :: Ptr (Bitwise a) -> Int -> Bitwise a -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO (Bitwise a) Source #

pokeByteOff :: Ptr b -> Int -> Bitwise a -> IO () Source #

peek :: Ptr (Bitwise a) -> IO (Bitwise a) Source #

poke :: Ptr (Bitwise a) -> Bitwise a -> IO () Source #

Ix a => Ix (Bitwise a) Source # |

Instance details

Defined in Data.Algebra.Boolean

Methods

range :: (Bitwise a, Bitwise a) -> [Bitwise a] Source #

index :: (Bitwise a, Bitwise a) -> Bitwise a -> Int Source #

unsafeIndex :: (Bitwise a, Bitwise a) -> Bitwise a -> Int Source #

inRange :: (Bitwise a, Bitwise a) -> Bitwise a -> Bool Source #

rangeSize :: (Bitwise a, Bitwise a) -> Int Source #

unsafeRangeSize :: (Bitwise a, Bitwise a) -> Int Source #

Num a => Num (Bitwise a) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (+) :: Bitwise a -> Bitwise a -> Bitwise a Source # (-) :: Bitwise a -> Bitwise a -> Bitwise a Source # (*) :: Bitwise a -> Bitwise a -> Bitwise a Source # negate :: Bitwise a -> Bitwise a Source # abs :: Bitwise a -> Bitwise a Source # signum :: Bitwise a -> Bitwise a Source # fromInteger :: Integer -> Bitwise a Source #
Read a => Read (Bitwise a) Source # |
Instance details Defined in Data.Algebra.Boolean Methods readsPrec :: Int -> ReadS (Bitwise a) Source # readList :: ReadS [Bitwise a] Source # readPrec :: ReadPrec (Bitwise a) Source # readListPrec :: ReadPrec [Bitwise a] Source #
Integral a => Integral (Bitwise a) Source # |

Instance details

Defined in Data.Algebra.Boolean

Methods

quot :: Bitwise a -> Bitwise a -> Bitwise a Source #

rem :: Bitwise a -> Bitwise a -> Bitwise a Source #

div :: Bitwise a -> Bitwise a -> Bitwise a Source #

mod :: Bitwise a -> Bitwise a -> Bitwise a Source #

quotRem :: Bitwise a -> Bitwise a -> (Bitwise a, Bitwise a) Source #

divMod :: Bitwise a -> Bitwise a -> (Bitwise a, Bitwise a) Source #

toInteger :: Bitwise a -> Integer Source #

Real a => Real (Bitwise a) Source # |
Instance details Defined in Data.Algebra.Boolean Methods toRational :: Bitwise a -> Rational Source #
Show a => Show (Bitwise a) Source # |
Instance details Defined in Data.Algebra.Boolean Methods showsPrec :: Int -> Bitwise a -> ShowS Source # show :: Bitwise a -> String Source # showList :: [Bitwise a] -> ShowS Source #
Eq a => Eq (Bitwise a) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (==) :: Bitwise a -> Bitwise a -> Bool Source # (/=) :: Bitwise a -> Bitwise a -> Bool Source #
Ord a => Ord (Bitwise a) Source # |

Instance details

Defined in Data.Algebra.Boolean

Methods

compare :: Bitwise a -> Bitwise a -> Ordering Source #

(<) :: Bitwise a -> Bitwise a -> Bool Source #

(<=) :: Bitwise a -> Bitwise a -> Bool Source #

(>) :: Bitwise a -> Bitwise a -> Bool Source #

(>=) :: Bitwise a -> Bitwise a -> Bool Source #

max :: Bitwise a -> Bitwise a -> Bitwise a Source #

min :: Bitwise a -> Bitwise a -> Bitwise a Source #

and :: (Boolean b, Foldable t) => t b -> b Source #

The logical conjunction of several values.

or :: (Boolean b, Foldable t) => t b -> b Source #

The logical disjunction of several values.

nand :: (Boolean b, Foldable t) => t b -> b Source #

The negated logical conjunction of several values.

    nand = not . and

nor :: (Boolean b, Foldable t) => t b -> b Source #

The negated logical disjunction of several values.

    nor = not . or

any :: (Boolean b, Foldable t) => (a -> b) -> t a -> b Source #

The logical disjunction of the mapping of a function over several values.

all :: (Boolean b, Foldable t) => (a -> b) -> t a -> b Source #

The logical conjunction of the mapping of a function over several values.

newtype Opp a Source #

Constructors

Opp |

Fields

- getOpp :: a

#### Instances

Instances details

Boolean a => Boolean (Opp a) Source # | Opposite boolean algebra: exchanges true and false, and `and` and `or`, etc
Instance details Defined in Data.Algebra.Boolean Methods true :: Opp a Source # false :: Opp a Source # not :: Opp a -> Opp a Source # (&&) :: Opp a -> Opp a -> Opp a Source # (||) :: Opp a -> Opp a -> Opp a Source # xor :: Opp a -> Opp a -> Opp a Source # (-->) :: Opp a -> Opp a -> Opp a Source # (<-->) :: Opp a -> Opp a -> Opp a Source #
Show a => Show (Opp a) Source # |
Instance details Defined in Data.Algebra.Boolean Methods showsPrec :: Int -> Opp a -> ShowS Source # show :: Opp a -> String Source # showList :: [Opp a] -> ShowS Source #
Eq a => Eq (Opp a) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (==) :: Opp a -> Opp a -> Bool Source # (/=) :: Opp a -> Opp a -> Bool Source #
Ord a => Ord (Opp a) Source # |
Instance details Defined in Data.Algebra.Boolean Methods compare :: Opp a -> Opp a -> Ordering Source # (<) :: Opp a -> Opp a -> Bool Source # (<=) :: Opp a -> Opp a -> Bool Source # (>) :: Opp a -> Opp a -> Bool Source # (>=) :: Opp a -> Opp a -> Bool Source # max :: Opp a -> Opp a -> Opp a Source # min :: Opp a -> Opp a -> Opp a Source #

newtype AnyB b Source #

A boolean algebra regarded as a monoid under disjunction

Constructors

AnyB |

Fields

- getAnyB :: b

#### Instances

Instances details

Boolean b => Monoid (AnyB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods mempty :: AnyB b Source # mappend :: AnyB b -> AnyB b -> AnyB b Source # mconcat :: [AnyB b] -> AnyB b Source #
Boolean b => Semigroup (AnyB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (<>) :: AnyB b -> AnyB b -> AnyB b Source # sconcat :: NonEmpty (AnyB b) -> AnyB b Source # stimes :: Integral b0 => b0 -> AnyB b -> AnyB b Source #
Show b => Show (AnyB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods showsPrec :: Int -> AnyB b -> ShowS Source # show :: AnyB b -> String Source # showList :: [AnyB b] -> ShowS Source #
Eq b => Eq (AnyB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (==) :: AnyB b -> AnyB b -> Bool Source # (/=) :: AnyB b -> AnyB b -> Bool Source #
Ord b => Ord (AnyB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods compare :: AnyB b -> AnyB b -> Ordering Source # (<) :: AnyB b -> AnyB b -> Bool Source # (<=) :: AnyB b -> AnyB b -> Bool Source # (>) :: AnyB b -> AnyB b -> Bool Source # (>=) :: AnyB b -> AnyB b -> Bool Source # max :: AnyB b -> AnyB b -> AnyB b Source # min :: AnyB b -> AnyB b -> AnyB b Source #

newtype AllB b Source #

A boolean algebra regarded as a monoid under conjunction

Constructors

AllB |

Fields

- getAllB :: b

#### Instances

Instances details

Boolean b => Monoid (AllB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods mempty :: AllB b Source # mappend :: AllB b -> AllB b -> AllB b Source # mconcat :: [AllB b] -> AllB b Source #
Boolean b => Semigroup (AllB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (<>) :: AllB b -> AllB b -> AllB b Source # sconcat :: NonEmpty (AllB b) -> AllB b Source # stimes :: Integral b0 => b0 -> AllB b -> AllB b Source #
Show b => Show (AllB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods showsPrec :: Int -> AllB b -> ShowS Source # show :: AllB b -> String Source # showList :: [AllB b] -> ShowS Source #
Eq b => Eq (AllB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (==) :: AllB b -> AllB b -> Bool Source # (/=) :: AllB b -> AllB b -> Bool Source #
Ord b => Ord (AllB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods compare :: AllB b -> AllB b -> Ordering Source # (<) :: AllB b -> AllB b -> Bool Source # (<=) :: AllB b -> AllB b -> Bool Source # (>) :: AllB b -> AllB b -> Bool Source # (>=) :: AllB b -> AllB b -> Bool Source # max :: AllB b -> AllB b -> AllB b Source # min :: AllB b -> AllB b -> AllB b Source #

newtype XorB b Source #

A boolean algebra regarded as a monoid under exclusive or

Constructors

XorB |

Fields

- getXorB :: b

#### Instances

Instances details

Boolean b => Monoid (XorB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods mempty :: XorB b Source # mappend :: XorB b -> XorB b -> XorB b Source # mconcat :: [XorB b] -> XorB b Source #
Boolean b => Semigroup (XorB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (<>) :: XorB b -> XorB b -> XorB b Source # sconcat :: NonEmpty (XorB b) -> XorB b Source # stimes :: Integral b0 => b0 -> XorB b -> XorB b Source #
Show b => Show (XorB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods showsPrec :: Int -> XorB b -> ShowS Source # show :: XorB b -> String Source # showList :: [XorB b] -> ShowS Source #
Eq b => Eq (XorB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (==) :: XorB b -> XorB b -> Bool Source # (/=) :: XorB b -> XorB b -> Bool Source #
Ord b => Ord (XorB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods compare :: XorB b -> XorB b -> Ordering Source # (<) :: XorB b -> XorB b -> Bool Source # (<=) :: XorB b -> XorB b -> Bool Source # (>) :: XorB b -> XorB b -> Bool Source # (>=) :: XorB b -> XorB b -> Bool Source # max :: XorB b -> XorB b -> XorB b Source # min :: XorB b -> XorB b -> XorB b Source #

newtype EquivB b Source #

A boolean algebra regarded as a monoid under equivalence

Constructors

EquivB |

Fields

- getEquivB :: b

#### Instances

Instances details

Boolean b => Monoid (EquivB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods mempty :: EquivB b Source # mappend :: EquivB b -> EquivB b -> EquivB b Source # mconcat :: [EquivB b] -> EquivB b Source #
Boolean b => Semigroup (EquivB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (<>) :: EquivB b -> EquivB b -> EquivB b Source # sconcat :: NonEmpty (EquivB b) -> EquivB b Source # stimes :: Integral b0 => b0 -> EquivB b -> EquivB b Source #
Show b => Show (EquivB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods showsPrec :: Int -> EquivB b -> ShowS Source # show :: EquivB b -> String Source # showList :: [EquivB b] -> ShowS Source #
Eq b => Eq (EquivB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods (==) :: EquivB b -> EquivB b -> Bool Source # (/=) :: EquivB b -> EquivB b -> Bool Source #
Ord b => Ord (EquivB b) Source # |
Instance details Defined in Data.Algebra.Boolean Methods compare :: EquivB b -> EquivB b -> Ordering Source # (<) :: EquivB b -> EquivB b -> Bool Source # (<=) :: EquivB b -> EquivB b -> Bool Source # (>) :: EquivB b -> EquivB b -> Bool Source # (>=) :: EquivB b -> EquivB b -> Bool Source # max :: EquivB b -> EquivB b -> EquivB b Source # min :: EquivB b -> EquivB b -> EquivB b Source #