[GHC] #15078: base: Customary type class laws (e.g. for Eq) and non-abiding instances (e.g. Float) should be documented
GHC
ghc-devs at haskell.org
Sun Jun 17 17:21:25 UTC 2018
#15078: base: Customary type class laws (e.g. for Eq) and non-abiding instances
(e.g. Float) should be documented
-------------------------------------+-------------------------------------
Reporter: sjakobi | Owner: Azel
Type: feature request | Status: merge
Priority: normal | Milestone: 8.6.1
Component: Core Libraries | Version: 8.4.2
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4736
Wiki Page: |
-------------------------------------+-------------------------------------
Description changed by sjakobi:
Old description:
> As beginning Haskellers regularly ask about these laws and instances I
> think it would be good to have them documented where they are defined.
>
> === Documented so far:
>
> (in 793902e6891c30150fd3ac1e0e471269a4766780)
>
> ==== Classes
>
> * `Eq`
> * `Floating`
> * `Fractional`
> * `Integral`
> * `Num`
> * `Ord`
>
> ==== Non-abiding instances
>
> * `CDouble` (shares `Double`'s deficiencies)
> * `CFloat` (shares `Float`'s deficiencies)
> * `Complex a` (inherits deficiencies)
> * `Double`: `Eq`, `Ord`, `Fractional`, `Num`
> * `Float`: `Eq`, `Ord`, `Fractional`, `Num`
> * `Ratio a` (inherits deficiencies)
> * `Natural`: `Num`
>
> === TODO:
>
> * `RealFrac`
New description:
As beginning Haskellers regularly ask about these laws and instances I
think it would be good to have them documented where they are defined.
=== Documented so far:
(in 793902e6891c30150fd3ac1e0e471269a4766780)
==== Classes
* `Eq`
* `Floating`
* `Fractional`
* `Integral`
* `Num`
* `Ord`
==== Non-abiding instances
* `CDouble` (shares `Double`'s deficiencies)
* `CFloat` (shares `Float`'s deficiencies)
* `Complex a` (inherits deficiencies)
* `Double`: `Eq`, `Ord`, `Fractional`, `Num`
* `Float`: `Eq`, `Ord`, `Fractional`, `Num`
* `Ratio a` (inherits deficiencies)
* `Natural`: `Num`
=== TODO
(This is not an exhaustive list, please add more)
* `RealFrac`
--
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15078#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list