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.
Synopsis
- class HasPositiveInfinity a where
- positiveInfinity :: a
- isPositiveInfinity :: a -> Bool
- class HasNegativeInfinity a where
- negativeInfinity :: a
- isNegativeInfinity :: a -> Bool
- 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
.
Methods
positiveInfinity :: a Source #
A positive infinite value
isPositiveInfinity :: a -> Bool Source #
Test if a value is positive infinity.
Instances
HasPositiveInfinity Double Source # | |
Defined in Data.Semiring | |
HasPositiveInfinity Float Source # | |
Defined in Data.Semiring | |
HasPositiveInfinity CFloat Source # | |
Defined in Data.Semiring | |
HasPositiveInfinity CDouble Source # | |
Defined in Data.Semiring | |
HasPositiveInfinity (Infinite a) Source # | |
Defined in Data.Semiring.Infinite | |
HasPositiveInfinity (PositiveInfinite a) Source # | |
Defined in Data.Semiring.Infinite Methods positiveInfinity :: PositiveInfinite a Source # isPositiveInfinity :: PositiveInfinite a -> Bool Source # |
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
.
Methods
negativeInfinity :: a Source #
A negative infinite value
isNegativeInfinity :: a -> Bool Source #
Test if a value is negative infinity.
Instances
HasNegativeInfinity Double Source # | |
Defined in Data.Semiring | |
HasNegativeInfinity Float Source # | |
Defined in Data.Semiring | |
HasNegativeInfinity CFloat Source # | |
Defined in Data.Semiring | |
HasNegativeInfinity CDouble Source # | |
Defined in Data.Semiring | |
HasNegativeInfinity (Infinite a) Source # | |
Defined in Data.Semiring.Infinite | |
HasNegativeInfinity (NegativeInfinite a) Source # | |
Defined in Data.Semiring.Infinite Methods negativeInfinity :: NegativeInfinite a Source # isNegativeInfinity :: NegativeInfinite a -> Bool Source # |
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.