diff options
author | sheaf <sam.derbyshire@gmail.com> | 2023-04-29 18:59:10 +0200 |
---|---|---|
committer | sheaf <sam.derbyshire@gmail.com> | 2023-04-29 20:23:06 +0200 |
commit | 57277662989b97dbf5ddc034d6c41ce39ab674ab (patch) | |
tree | 7d9fe1c4cb95a8bcf82490c354b5df0e9ab9037c /docs | |
parent | 4eaf2c2a7682fa9933261f5eb25da9e2333c9608 (diff) | |
download | haskell-57277662989b97dbf5ddc034d6c41ce39ab674ab.tar.gz |
Add the Unsatisfiable class
This commit implements GHC proposal #433, adding the Unsatisfiable
class to the GHC.TypeError module. This provides an alternative to
TypeError for which error reporting is more predictable: we report it
when we are reporting unsolved Wanted constraints.
Fixes #14983 #16249 #16906 #18310 #20835
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/9.8.1-notes.rst | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/users_guide/9.8.1-notes.rst b/docs/users_guide/9.8.1-notes.rst index 0f0848765f..9f2d51d329 100644 --- a/docs/users_guide/9.8.1-notes.rst +++ b/docs/users_guide/9.8.1-notes.rst @@ -93,6 +93,21 @@ Compiler with each other, communicating via the system semaphore specified by the flag argument. +- GHC Proposal `#433 + <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0433-unsatisfiable.rst>`_ + has been implemented. This adds the class ``Unsatisfiable :: ErrorMessage -> Constraint`` + to the ``GHC.TypeError`` module. Constraints of the form ``Unsatisfiable msg`` + provide a mechanism for custom type errors that reports the errors in a more + predictable behaviour than ``TypeError``, as these constraints are + handled purely during constraint solving. + + For example: :: + + instance Unsatisfiable (Text "There is no Eq instance for functions") => Eq (a -> b) where + (==) = unsatisfiable + + This allows errors to be reported when users use the instance, even when + type errors are being deferred. GHCi ~~~~ |