Changes between Version 7 and Version 8 of StandardClasses


Ignore:
Timestamp:
Sep 14, 2006 9:24:47 AM (9 years ago)
Author:
ross@…
Comment:

add refs, plus minor changes

Legend:

Unmodified
Added
Removed
Modified
  • StandardClasses

    v7 v8  
    44This page collects issues and proposals for the standard classes. 
    55Many of the proposals involve additional superclasses, which would be less burdensome with [ticket:101 class aliases] or something similar, but such features are not yet implemented. 
     6 
     7== References == 
     8 
     9 * [http://www.haskell.org/onlinereport/basic.html#sect6.3 Standard Haskell Classes] of Haskell 98 
     10 * [http://www.haskell.org/onlinereport/standard-prelude.html Standard Prelude] of Haskell 98 
     11 * [http://en.wikipedia.org/wiki/Algebraic_structure Algebraic structures] in !WikiPedia 
     12 * [http://www.haskell.org/docon/ DoCon the Algebraic Domain Constructor] 
     13 * [http://www.haskell.org/communities/06-2006/html/report.html#numericprelude Numeric prelude project] 
    614 
    715== Constructor classes == 
     
    2937If the Haskell 98 classes were retained for backwards compatibility, but with a more refined class hierarchy, the change would impact mostly on those defining instances (and these are the people inconvenienced by the current system). 
    3038Clients of the classes would notice only some more general types. 
    31 See also: 
    32  * [http://haskell.org/docon/ DoCon the Algebraic Domain Constructor] 
    33  * [http://haskell.org/communities/06-2006/html/report.html#numericprelude Numeric prelude project] 
    3439 
    3540=== The Num class === 
     
    4045 
    4146Proposals: 
    42  * a group-like class with `zero`, `(+)` and `negate`/`(-)` 
    43    (could be further split with a monoid sub-class) 
    44  * a ring-like subclass adding `(*)` and `one`/`fromInteger`, with the existing `Num` class as a further subclass. 
     47 * A group-like class with `zero`, `(+)` and `negate`/`(-)`. 
     48 * (Could be further split with a monoid sub-class.) 
     49 * A ring-like subclass adding `(*)` and `one`/`fromInteger`, with the existing `Num` class as a further subclass. 
    4550Note that the `Float` and `Double` instances will not satisfy the usual axioms for these structures. 
     51 
     52=== The Fractional class === 
     53Issues: 
     54 * `(/)`, `recip` and `fromRational` can be lifted to functions, but many of the pre-requisites can't be defined for these. 
     55 
     56Proposals: 
     57 * Add a division ring-like superclass adding these operations to the ring-like class. 
     58   (A division ring has the same operations as a field, but does not assume commutative multiplication, allowing structures such as quaternions.) 
     59 * (Could be further split with a semiring subclass.) 
     60 * Add default 
     61   {{{ 
     62fromRational x = fromInteger (numerator x) / fromInteger (denominator x) 
     63}}} 
     64   This is independent of all the other proposals. 
    4665 
    4766=== The Integral class === 
     
    5069   `Ord`, `Num(abs, signum)` and `toRational` don't make sense for polynomials and Gaussian integers. 
    5170   `quot` and `rem` assume an ordering. 
    52  
    53 === The Fractional class === 
    54 Issues: 
    55  * `(/)`, `recip` and `fromRational` can be lifted to functions, but many of the pre-requisites can't be defined for these. 
    56  
    57 Proposals: 
    58  * Add a field-like superclass adding these operations to the ring-like class. 
    59  * Add default 
    60    {{{ 
    61 fromRational x = fromInteger (numerator x) / fromInteger (denominator x) 
    62 }}} 
    63    This is independent of all the other proposals. 
    6471 
    6572== Other standard classes ==