class Semiring a where
The Semiring
class is for types that support an addition and multiplication operation.
Instances must satisfy the following laws:
(a + b) + c = a + (b + c)
zero + a = a + zero = a
a + b = b + a
(a * b) * c = a * (b * c)
one * a = a * one = a
a * (b + c) = (a * b) + (a * c)
(a + b) * c = (a * c) + (b * c)
zero * a = a * zero = zero
Note: The Number
and Int
types are not fully law abiding members of this class hierarchy due to the potential for arithmetic overflows, and in the case of Number
, the presence of NaN
and Infinity
values. The behaviour is unspecified in these cases.
Semiring Int
Semiring Number
(Semiring b) => Semiring (a -> b)
Semiring Unit
Semiring (Proxy a)
(RowToList row list, SemiringRecord list row row) => Semiring (Record row)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4