Type-level error messages
Iavor Diatchki
iavor.diatchki at gmail.com
Thu Oct 29 20:23:36 UTC 2015
Hello,
I've updated the implementation to match the discussion from this morning.
The idea is that `TypeError msd` is a type-family that can never be
reduced, similar to `Any`. We don't do anything special in the constraint
solver, however when printing errors, if we encounter any constraints of
the form:
* TypeError msg
* TypeError msg ~ Something
* Something ~ TypeError msg
Then we evaluate `msg` and use it as the error message.
This is fairly simple, and appears to work quite well. The implementation
is on branch `wip/custom-type-errors` (
https://github.com/ghc/ghc/tree/wip/custom-type-errors).
== Arc Difficulties Below ===
I tried to update the Phabricator patch but failed. This is what I did:
1. arc diff master --update D1236 --head custom-type-errors
Exception
ERR-CONDUIT-CALL: API Method "differential.creatediff" does not define
these parameters: 'arcanistProject'.
(Run with `--trace` for a full exception trace.)
2. I thought that maybe I need to update `arcanist`, so I pulled the latest
version for git.
3. arc diff master --update D1236 --head custom-type-errors
Exception
Failed to load class or interface 'PhutilClassMapQuery': the class or
interface 'PhutilClassMapQuery' is not defined in the library map for any
loaded phutil library. If this symbol was recently added or moved, your
library map may be out of date. You can rebuild the map by running 'arc
liberate'. For more information, see:
http://www.phabricator.com/docs/phabricator/article/libphutil_Libraries_User_Guide.html
(Run with `--trace` for a full exception trace.)
4. arc liberate
Exception
Failed to load class or interface 'PhutilClassMapQuery': the class or
interface 'PhutilClassMapQuery' is not defined in the library map for any
loaded phutil library. If this symbol was recently added or moved, your
library map may be out of date. You can rebuild the map by running 'arc
liberate'. For more information, see:
http://www.phabricator.com/docs/phabricator/article/libphutil_Libraries_User_Guide.html
(Run with `--trace` for a full exception trace.)
Any advice on what I am doing wrong?
-Iavor
On Wed, Oct 28, 2015 at 10:17 AM, Iavor Diatchki <iavor.diatchki at gmail.com>
wrote:
> I have also written my thoughts on the questions posed by Richard on the
> wiki page.
>
>
>
>
> On Wed, Oct 28, 2015 at 7:07 AM, Richard Eisenberg <eir at cis.upenn.edu>
> wrote:
>
>>
>> On Oct 28, 2015, at 10:02 AM, "Augustsson, Lennart" <
>> Lennart.Augustsson at sc.com> wrote:
>>
>> > I've put in my answers to your questions.
>>
>> And I've responded.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20151029/d461909f/attachment-0001.html>
More information about the ghc-devs
mailing list