| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Semiring.Infinite
Description
This module provides various "infinite" wrappers, which can provide a detectable infinity to an otherwise non-infinite type.
- class HasPositiveInfinity a where
- class HasNegativeInfinity a where
- data NegativeInfinite a
- = NegativeInfinity
- | NegFinite !a
- data PositiveInfinite a
- = PosFinite !a
- | PositiveInfinity
- data Infinite a
Documentation
class HasPositiveInfinity a where Source #
A class for semirings with a concept of "infinity". It's important that
this isn't regarded as the same as "bounded":
x should probably equal <+> positiveInfinitypositiveInfinity.
Methods
positiveInfinity :: a Source #
A positive infinite value
positiveInfinity :: RealFloat a => a Source #
A positive infinite value
isPositiveInfinity :: a -> Bool Source #
Test if a value is positive infinity.
isPositiveInfinity :: RealFloat a => a -> Bool Source #
Test if a value is positive infinity.
class HasNegativeInfinity a where Source #
A class for semirings with a concept of "negative infinity". It's important
that this isn't regarded as the same as "bounded":
x should probably equal <+> negativeInfinitynegativeInfinity.
Methods
negativeInfinity :: a Source #
A negative infinite value
negativeInfinity :: RealFloat a => a Source #
A negative infinite value
isNegativeInfinity :: a -> Bool Source #
Test if a value is negative infinity.
isNegativeInfinity :: RealFloat a => a -> Bool Source #
Test if a value is negative infinity.
data NegativeInfinite a Source #
Adds negative infinity to a type. Useful for expressing detectable infinity
in types like Integer, etc.
Constructors
| NegativeInfinity | |
| NegFinite !a |
Instances
| Functor NegativeInfinite Source # | |
| Applicative NegativeInfinite Source # | |
| Foldable NegativeInfinite Source # | |
| Traversable NegativeInfinite Source # | |
| Generic1 NegativeInfinite Source # | |
| Bounded a => Bounded (NegativeInfinite a) Source # | |
| (Enum a, Bounded a, Eq a) => Enum (NegativeInfinite a) Source # | |
| Eq a => Eq (NegativeInfinite a) Source # | |
| Num a => Num (NegativeInfinite a) Source # | |
| Ord a => Ord (NegativeInfinite a) Source # | |
| Read a => Read (NegativeInfinite a) Source # | |
| Show a => Show (NegativeInfinite a) Source # | |
| Generic (NegativeInfinite a) Source # | |
| Monoid a => Monoid (NegativeInfinite a) Source # | |
| Storable a => Storable (NegativeInfinite a) Source # | |
| HasNegativeInfinity (NegativeInfinite a) Source # | |
| DetectableZero a => DetectableZero (NegativeInfinite a) Source # | |
| DetectableZero a => Semiring (NegativeInfinite a) Source # | Doesn't follow |
| type Rep1 NegativeInfinite Source # | |
| type Rep (NegativeInfinite a) Source # | |
data PositiveInfinite a Source #
Adds positive infinity to a type. Useful for expressing detectable infinity
in types like Integer, etc.
Constructors
| PosFinite !a | |
| PositiveInfinity |
Instances
Adds positive and negative infinity to a type. Useful for expressing
detectable infinity in types like Integer, etc.
Instances
| Functor Infinite Source # | |
| Applicative Infinite Source # | |
| Foldable Infinite Source # | |
| Traversable Infinite Source # | |
| Generic1 Infinite Source # | |
| Bounded (Infinite a) Source # | |
| (Enum a, Bounded a, Eq a) => Enum (Infinite a) Source # | |
| Eq a => Eq (Infinite a) Source # | |
| Num a => Num (Infinite a) Source # | |
| Ord a => Ord (Infinite a) Source # | |
| Read a => Read (Infinite a) Source # | |
| Show a => Show (Infinite a) Source # | |
| Generic (Infinite a) Source # | |
| Monoid a => Monoid (Infinite a) Source # | |
| Storable a => Storable (Infinite a) Source # | |
| HasNegativeInfinity (Infinite a) Source # | |
| HasPositiveInfinity (Infinite a) Source # | |
| (DetectableZero a, Ord a) => DetectableZero (Infinite a) Source # | |
| (DetectableZero a, Ord a) => Semiring (Infinite a) Source # | Not distributive. |
| type Rep1 Infinite Source # | |
| type Rep (Infinite a) Source # | |