Skip to content

Commit 5817af2

Browse files
committed
Update Field
1 parent 94ce7ef commit 5817af2

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/Data/Field.purs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@ import Data.Semiring (class Semiring, add, mul, one, zero, (*), (+))
1515

1616
-- | The `Field` class is for types that are (commutative) fields.
1717
-- |
18-
-- | Instances must satisfy the following law in addition to the
19-
-- | `EuclideanRing` laws:
20-
-- |
21-
-- | - Non-zero multiplicative inverse: ``a `mod` b = zero`` for all `a` and `b`
22-
-- |
23-
-- | If a type has a `Field` instance, it should also have a `DivisionRing`
24-
-- | instance. In a future release, `DivisionRing` may become a superclass of
25-
-- | `Field`.
26-
class EuclideanRing a <= Field a
18+
-- | `Field`s are exactly `DivisionRing` + `CommutativeRing` so this class
19+
-- | exists as a convenience, so a single constraint can be used when field-like
20+
-- | behaviour is expected.
21+
class (EuclideanRing a, CommutativeRing a) <= Field a
2722

28-
instance fieldNumber :: Field Number
23+
instance fieldNumber :: (EuclideanRing a, CommutativeRing a) => Field a

0 commit comments

Comments
 (0)