Commit a7ad0b91 authored by Ryan Scott's avatar Ryan Scott
Browse files

Make TypeError a newtype, add changelog entry

Phab:D866 added the `TypeError` datatype to `Control.Exception` to represent
the error that is thrown when `-fdefer-type-errors` is on, but a changelog
entry for it was never added. In addition, it should probably be a

Reviewers: austin, hvr, KaneTW, bgamari

Reviewed By: KaneTW, bgamari

Subscribers: thomie, KaneTW

Differential Revision:

GHC Trac Issues: #10284
parent 07ed2413
......@@ -304,6 +304,10 @@ Compiler
:ghc-flag:`-this-unit-id` or, if you need compatibility over multiple
versions of GHC, :ghc-flag:`-package-name`.
- When :ghc-flag:`-fdefer-type-errors` is enabled and an expression fails to
typecheck, ``Control.Exception.TypeError`` will now be thrown instead of
......@@ -527,6 +531,10 @@ See ```` in the ``base`` package for full release notes.
- Enable ``PolyKinds`` in the ``Data.Functor.Const`` module to give ``Const``
the kind ``* -> k -> *`` (see :ghc-ticket:`10039`).
- Add the ``TypeError`` datatype to ``Control.Exception``, which represents the
error that is thrown when an expression fails to typecheck when run using
:ghc-flag:`-fdefer-type-errors`. (see :ghc-ticket:`10284`)
......@@ -361,7 +361,9 @@ instance Exception NoMethodError
-- |An expression that didn't typecheck during compile time was called.
-- This is only possible with -fdefer-type-errors. The @String@ gives
-- details about the failed type check.
data TypeError = TypeError String
-- @since
newtype TypeError = TypeError String
instance Show TypeError where
showsPrec _ (TypeError err) = showString err
......@@ -91,6 +91,9 @@
precision: `log1p`, `expm1`, `log1pexp` and `log1mexp`. These are not
available from `Prelude`, but the full class is exported from `Numeric`.
* New `Control.Exception.TypeError` datatype, which is thrown when an
expression fails to typecheck when run using `-fdefer-type-errors` (#10284)
### New instances
* `Alt`, `Dual`, `First`, `Last`, `Product`, and `Sum` now have `Data`,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment