... | ... | @@ -132,8 +132,33 @@ g x = x `f` "hello" |
|
|
|
|
|
### `base-4.16.*`
|
|
|
|
|
|
#### `Nat` is a synonym for `Natural`
|
|
|
|
|
|
The `Nat` kind is now a type synonym for `Natural` (from `Numeric.Natural`). As a consequence, one must enable `TypeSynonymInstances` in order to define instances for `Nat`.
|
|
|
|
|
|
#### Changes to the `(<=)` and `(<=?)` type families
|
|
|
|
|
|
A new kind-polymorphic `Compare` type family was added in the `Data.Type.Ord` module, and moreover, the `(<=?)` and `(<=)` type families from `GHC.TypeNats` are now defined in terms of `Compare`. This has two important repercussions:
|
|
|
|
|
|
* GHC can no longer deduce that all natural numbers are greater than or equal to zero. For instance, this program will no longer typecheck:
|
|
|
|
|
|
```hs
|
|
|
test1 :: Proxy (0 <=? x) -> Proxy True
|
|
|
test1 = id
|
|
|
```
|
|
|
* When `(<=)` or `(<=?)` are used very generically, a kind may need to be provided. For example, this program:
|
|
|
|
|
|
```hs
|
|
|
test2 :: Proxy (x <=? x) -> Proxy True
|
|
|
test2 = id
|
|
|
```
|
|
|
|
|
|
Will now generate a type error because GHC does not know the kind of `x`. To fix this, one must provide an explicit kind, perhaps by changing the type to:
|
|
|
|
|
|
```hs
|
|
|
test2 :: forall (x :: Nat). Proxy (x <=? x) -> Proxy True
|
|
|
```
|
|
|
|
|
|
### `ghc-prim-0.8.*`
|
|
|
|
|
|
TODO: Mention `Int{8,16,32}#`/`Word{8,16,32}#`-related changes
|
... | ... | |