| ... | @@ -4,20 +4,9 @@ |
... | @@ -4,20 +4,9 @@ |
|
|
This page collects issues and proposals for the standard classes.
|
|
This page collects issues and proposals for the standard classes.
|
|
|
Many of the proposals involve additional superclasses, which would be less burdensome with [class aliases](https://gitlab.haskell.org//haskell/prime/issues/101) or something similar, but such features are not yet implemented.
|
|
Many of the proposals involve additional superclasses, which would be less burdensome with [class aliases](https://gitlab.haskell.org//haskell/prime/issues/101) or something similar, but such features are not yet implemented.
|
|
|
|
|
|
|
|
## The Read class
|
|
## Constructor classes
|
|
|
|
|
|
|
|
|
|
### The Functor class
|
|
|
See [ReadClass](read-class).
|
|
|
|
|
|
|
|
|
|
## The Enum class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Issues:
|
|
|
|
|
|
|
|
|
|
- `succ` and `pred` are unused.
|
|
|
|
|
- The default definitions of `enum`\* would make more sense if `toEnum` and `fromEnum` used `Integer` instead of `Int`.
|
|
|
|
|
|
|
|
|
|
## The Functor class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Proposal:
|
|
Proposal:
|
| ... | @@ -66,7 +55,8 @@ Issues: |
... | @@ -66,7 +55,8 @@ Issues: |
|
|
|
|
|
|
|
Proposals:
|
|
Proposals:
|
|
|
|
|
|
|
|
- a group-like class with `zero`, `(+)` and `negate`/`(-)`.
|
|
- a group-like class with `zero`, `(+)` and `negate`/`(-)`
|
|
|
|
(could be further split with a monoid sub-class)
|
|
|
- a ring-like subclass adding `(*)` and `one`/`fromInteger`, with the existing `Num` class as a further subclass.
|
|
- a ring-like subclass adding `(*)` and `one`/`fromInteger`, with the existing `Num` class as a further subclass.
|
|
|
|
|
|
|
|
|
|
|
| ... | @@ -77,8 +67,9 @@ Note that the `Float` and `Double` instances will not satisfy the usual axioms f |
... | @@ -77,8 +67,9 @@ Note that the `Float` and `Double` instances will not satisfy the usual axioms f |
|
|
|
|
|
|
|
Issues:
|
|
Issues:
|
|
|
|
|
|
|
|
- `div` and `mod` also sense for rationals and polynomials, but `Ord`, `Num` and `toInteger` (and `toRational` for polynomials) don't.
|
|
- `div` and `mod` also sense for rationals and polynomials, but `toInteger` does not.
|
|
|
However `quot` and `rem` assume an ordering.
|
|
`Ord`, `Num(abs, signum)`, `toInteger` and `toRational` don't make sense for polynomials.
|
|
|
|
`quot` and `rem` assume an ordering.
|
|
|
|
|
|
|
|
### The Fractional class
|
|
### The Fractional class
|
|
|
|
|
|
| ... | @@ -99,7 +90,22 @@ Proposals: |
... | @@ -99,7 +90,22 @@ Proposals: |
|
|
|
|
|
|
|
This is independent of all the other proposals.
|
|
This is independent of all the other proposals.
|
|
|
|
|
|
|
|
## The Ix class
|
|
## Other standard classes
|
|
|
|
|
|
|
|
### The Read class
|
|
|
|
|
|
|
|
|
|
|
|
See [ReadClass](read-class).
|
|
|
|
|
|
|
|
### The Enum class
|
|
|
|
|
|
|
|
|
|
|
|
Issues:
|
|
|
|
|
|
|
|
- `succ` and `pred` are unused.
|
|
|
|
- The default definitions of `enum`\* would make more sense if `toEnum` and `fromEnum` used `Integer` instead of `Int`.
|
|
|
|
|
|
|
|
### The Ix class
|
|
|
|
|
|
|
|
|
|
|
|
|
Issues:
|
|
Issues:
|
| ... | | ... | |