| ... | ... | @@ -149,7 +149,7 @@ A static error, because there are no defaults declared for any of the classes in |
|
|
|
### Backwards compatibility
|
|
|
|
|
|
|
|
|
|
|
|
The current Haskell'98 default-default behaviour can be specified as:
|
|
|
|
The current Haskell'98 default-default behaviour can (nearly) be specified as:
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
default Num Integer
|
| ... | ... | @@ -162,6 +162,9 @@ default Floating Double |
|
|
|
default RealFloat Double
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
However, there are some incompatible cases where the new rule would cause a valid H'98 program to be rejected. For instance the expression `toRational pi` has the constraints `Floating` on pi and `Real` on toRational: in H'98, the type Double is the first type that satisfies both constraints, but with the proposed new rule no type would satisfy the constraints, so the expression would be rejected. To fix, you would need to annotate `pi` with a type.
|
|
|
|
|
|
|
|
### Turning off defaults
|
|
|
|
|
|
|
|
|
| ... | ... | |