Skip to content
Snippets Groups Projects
Commit e483775c authored by Daniel Winograd-Cort's avatar Daniel Winograd-Cort Committed by Marge Bot
Browse files

Update changelog and release notes for Data.Type.Ord change

parent e145e44c
No related branches found
No related tags found
No related merge requests found
......@@ -234,6 +234,30 @@ Eventlog
charVal :: forall n proxy. KnownChar n => proxy n -> Char
charVal' :: forall n. KnownChar n => Proxy# n -> Char
- A new kind-polymorphic ``Compare`` type family was added in ``Data.Type.Ord``
and has type instances for ``Nat``, ``Symbol``, and ``Char``. Furthermore,
the ``(<=?)`` type (and ``(<=)``) from ``GHC.TypeNats`` is now governed by
this type family (as well as new comparison type operators that are exported
by ``Data.Type.Ord``). This has two important repercussions. First, GHC can
no longer deduce that all natural numbers are greater than or equal to zero.
For instance, ::
test1 :: Proxy (0 <=? x) -> Proxy True
test1 = id
which previously type checked will now result in a type error. Second, when
these comparison type operators are used very generically, a kind may need to
be provided. For example, ::
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: ::
test2 :: forall (x :: Nat). Proxy (x <=? x) -> Proxy True
- On POSIX, ``System.IO.openFile`` can no longer leak a file descriptor if it
is interrupted by an asynchronous exception (#19114, #19115).
......
......@@ -8,6 +8,14 @@
in order to define instances for `Nat`. Also, different instances for `Nat` and `Natural`
won't typecheck anymore.
* Add `Data.Type.Ord` as a module for type-level comparison operations. The
`(<=?)` type operator from `GHC.TypeNats`, previously kind-specific to
`Nat`, is now kind-polymorphic and governed by the `Compare` type family in
`Data.Type.Ord`. Note that this means GHC will no longer deduce `0 <= n`
for all `n` any more.
* Add `cmpNat`, `cmpSymbol`, and `cmpChar` to `GHC.TypeNats` and `GHC.TypeLits`.
* Add `Semigroup` and `Monoid` instances for `Data.Functor.Product` and
`Data.Functor.Compose`.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment