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 <+>
positiveInfinity
positiveInfinity
.
Minimal complete definition
Methods
positiveInfinity :: a Source #
A positive infinite value
isPositiveInfinity :: 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 <+>
negativeInfinity
negativeInfinity
.
Minimal complete definition
Methods
negativeInfinity :: a Source #
A negative infinite value
isNegativeInfinity :: 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
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