| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Numeric.Algebra.Rings.Field
Description
Provides the Field typeclass.
Since: 0.1
Documentation
class (Ring f, Semifield f) => Field f Source #
Defines a Field i.e. a structure that supports addition, subtraction,
multiplication, and division.
Examples:
- \( \mathbb{Q} \), the rationals.
>>>:{-- Addition f1 :: (Field k) => k -> k f1 x = x .+. x :}
>>>f1 510
>>>:{-- Zero f2 :: (Field k) => k -> k f2 x = x .+. zero :}
>>>f2 55
>>>:{-- Subtraction f3 :: (Field k, Num k) => k -> k f3 x = x .-. 3 :}
>>>f3 52
>>>:{-- Multiplication f4 :: (Field k) => k -> k f4 x = x .*. x :}
>>>f4 525
>>>:{-- One f5 :: (Field k) => k -> k f5 x = x .*. one :}
>>>f5 55
>>>:{-- Division f6 :: (Field k, Num k) => k -> k f6 x = x .%. 2 :}
f6 6 2
Since: 0.1