diff options
author | Daniel Winograd-Cort <dwincort@gmail.com> | 2021-03-07 10:53:29 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-08 07:32:53 -0500 |
commit | e483775c3ff39523d18c44f04b4842518437fba8 (patch) | |
tree | c821936346eec0bad642f6ec49c9cd7a2a496fc2 /docs/users_guide | |
parent | e145e44ce6de3afd07932f328c5efadb941f08aa (diff) | |
download | haskell-e483775c3ff39523d18c44f04b4842518437fba8.tar.gz |
Update changelog and release notes for Data.Type.Ord change
Diffstat (limited to 'docs/users_guide')
-rw-r--r-- | docs/users_guide/9.2.1-notes.rst | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/users_guide/9.2.1-notes.rst b/docs/users_guide/9.2.1-notes.rst index 183097048e..515dd4bbb2 100644 --- a/docs/users_guide/9.2.1-notes.rst +++ b/docs/users_guide/9.2.1-notes.rst @@ -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). |