Re: Fixing type synonyms to Uniq(D)FM newtypes

2020-06-23 Thread Andreas Klebinger

My main motivation for going with a phantom type over newtypes was that
it makes it easier to use in
an adhoc fashion without giving up type safety.

As a second benefit it seemed a lot easier to implement.

Cheers
Andreas



George Colpitts schrieb am 24.06.2020 um 00:40:

I read the email thread you refer to but it doesn't seem to explain
why you went with solution 2. If you think it worthwhile can you
explain here why you chose solution 2?

On Tue, Jun 23, 2020 at 6:55 PM Andreas Klebinger
mailto:klebinger.andr...@gmx.at>> wrote:

There was a discussion about making UniqFM typed for the keys here a
while ago.
(https://mail.haskell.org/pipermail/ghc-devs/2020-January/018451.html
and following)

I wrote up an MR for one possible approach here:
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3577

It implements solution 2 from that discussion.

Just while getting the patch to typecheck I've already seen a
number of
cases where this increased
readability of the code quite a bit so I think it's a good
improvement.

If there are strong objections to this solution let me know. In that
case I'm happy to abandon the patch.
If not I will clean it up and get it ready for merging.


___
ghc-devs mailing list
ghc-devs@haskell.org 
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs



___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Fixing type synonyms to Uniq(D)FM newtypes

2020-06-23 Thread George Colpitts
I read the email thread you refer to but it doesn't seem to explain why you
went with solution 2. If you think it worthwhile can you explain here why
you chose solution 2?

On Tue, Jun 23, 2020 at 6:55 PM Andreas Klebinger 
wrote:

> There was a discussion about making UniqFM typed for the keys here a
> while ago.
> (https://mail.haskell.org/pipermail/ghc-devs/2020-January/018451.html
> and following)
>
> I wrote up an MR for one possible approach here:
> https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3577
>
> It implements solution 2 from that discussion.
>
> Just while getting the patch to typecheck I've already seen a number of
> cases where this increased
> readability of the code quite a bit so I think it's a good improvement.
>
> If there are strong objections to this solution let me know. In that
> case I'm happy to abandon the patch.
> If not I will clean it up and get it ready for merging.
>
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Fixing type synonyms to Uniq(D)FM newtypes

2020-06-23 Thread Andreas Klebinger

There was a discussion about making UniqFM typed for the keys here a
while ago.
(https://mail.haskell.org/pipermail/ghc-devs/2020-January/018451.html
and following)

I wrote up an MR for one possible approach here:
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3577

It implements solution 2 from that discussion.

Just while getting the patch to typecheck I've already seen a number of
cases where this increased
readability of the code quite a bit so I think it's a good improvement.

If there are strong objections to this solution let me know. In that
case I'm happy to abandon the patch.
If not I will clean it up and get it ready for merging.


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs