Further custom type error questions

Ben Gamari ben at smart-cactus.org
Mon Nov 16 21:21:46 UTC 2015

While preparing some additional documentation for Iavor's custom type
errors work (which has been merged; thanks Iavor!) I noticed that
Dominique Devriese has raised some additional questions on the proposal

In particular, Dominique suggests that perhaps TypeError should simply
be of kind `ErrorMessage -> Constraint`. My understanding of the
proposal is that the intention is that `TypeError`s should be usable on
the RHS of type functions, like `error` on the term level. However, is
this strictly necessary? Is there any place where you couldn't just as
easily express the `TypeError` as a constraint?

If not, it seems like this may be substantially simpler approach and
totally side-steps the detection of `TypeError` in inappropriate places
on the RHS.

Regardless, it seems like this (and the other questions) is worth
addressing in the proposal.


- Ben

[1] https://ghc.haskell.org/trac/ghc/wiki/Proposal/CustomTypeErrors#SomedesignquestionsDominiqueDevriese:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20151116/28fdf6e3/attachment.sig>

More information about the ghc-devs mailing list