Implementation of Type level warnings

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Implementation of Type level warnings

Rowan Goemans
Hello everyone,

A couple of days ago I tried to implement type level warnings [1]. I have got something
now that sort of works but issues the same warning multiple times and not on the correct
location. It's currently a WIP merge request [2]. I would like some help/pointers
to continue the implementation

The approach I have taken is to issue the warning once TypeWarning is rewritten.
However, this has severe problems since now a warning is issued multiple times and
at different locations due to the rewriting happening multiple times. I don't know
what the best location is to do this check and issue the warning. Prior to
constraint solving isn't a good place since the TypeWarning could be nested
deeply in some constraint. Afterwards also isn't doable since then the
TypeWarning constraint is gone.

An alternative could be to not implement any instance in for TypeWarning
similar to TypeError and special case it somehow.

Any help is appreciated!

[1] https://gitlab.haskell.org/ghc/ghc/issues/17027
[2] https://gitlab.haskell.org/ghc/ghc/merge_requests/2361

Best regards,

Rowan Goemans
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: Implementation of Type level warnings

Richard Eisenberg-5
I've responded on the MR. Thanks for stepping up to do this!

Richard

On Dec 30, 2019, at 5:53 AM, Rowan Goemans <[hidden email]> wrote:

Hello everyone,

A couple of days ago I tried to implement type level warnings [1]. I have got something
now that sort of works but issues the same warning multiple times and not on the correct
location. It's currently a WIP merge request [2]. I would like some help/pointers
to continue the implementation

The approach I have taken is to issue the warning once TypeWarning is rewritten.
However, this has severe problems since now a warning is issued multiple times and
at different locations due to the rewriting happening multiple times. I don't know
what the best location is to do this check and issue the warning. Prior to
constraint solving isn't a good place since the TypeWarning could be nested
deeply in some constraint. Afterwards also isn't doable since then the
TypeWarning constraint is gone.

An alternative could be to not implement any instance in for TypeWarning
similar to TypeError and special case it somehow.

Any help is appreciated!

[1] https://gitlab.haskell.org/ghc/ghc/issues/17027
[2] https://gitlab.haskell.org/ghc/ghc/merge_requests/2361

Best regards,

Rowan Goemans
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs