Copyright | (C) 2015 Dimitri Sabadie |
---|---|
License | BSD3 |
Maintainer | Dimitri Sabadie <dimitri.sabadie@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Data.Zero
Description
Semigroups with absorbing element
class Semigroup a => Zero a where #
Semigroup
with a zero
element. It’s important to understand that the
standard Semigroup
types – i.e. Maybe
and so on – are already biased,
because they’re Monoid
s. That’s why you’ll find a few Zero
instances.
Should satisfies the following laws:
Annihilation
a<>
zero
=zero
<>
a =zero
Associativity
a<>
b<>
c = (a<>
b)<>
c = a<>
(b<>
c)
Minimal complete definition
Methods
The zero element.
Num wrappers
Monoid under multiplication.
Constructors
Product | |
Fields
|
Instances
Monad Product | Since: 4.8.0.0 |
Functor Product | Since: 4.8.0.0 |
MonadFix Product | Since: 4.8.0.0 |
Applicative Product | Since: 4.8.0.0 |
Foldable Product | Since: 4.8.0.0 |
Traversable Product | Since: 4.8.0.0 |
Bounded a => Bounded (Product a) | |
Eq a => Eq (Product a) | |
Num a => Num (Product a) | |
Ord a => Ord (Product a) | |
Read a => Read (Product a) | |
Show a => Show (Product a) | |
Generic (Product a) | |
Num a => Semigroup (Product a) | Since: 4.9.0.0 |
Num a => Monoid (Product a) | Since: 2.1 |
Num a => Zero (Product a) # | |
Generic1 * Product | |
type Rep (Product a) | |
type Rep1 * Product | |
Boolean wrappers
Boolean monoid under disjunction (||
).
Boolean monoid under conjunction (&&
).