You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow Newtype deriving for newtypes that use type synonyms #2416
No type class instance was found for
Data.Semigroup.Semigroup MyString
while checking that expression #dict Semigroup
has type { append :: WrappedString -> WrappedString -> WrappedString
}
in value declaration semigroupWrappedString
They fall into that general category yeah. But on the other hand I think we shouldn't normally allow instances for type synonyms, to avoid confusion. So we want them to be desugared for deriving, but not for a hand written instance.
Activity
paf31 commentedon Nov 7, 2016
This is the same as the corresponding Generic deriving issue, right?
garyb commentedon Nov 7, 2016
I don't know if it is exactly, the error is that you're not allowed to declare instances for type synonyms... is that the same reason it fails there?
paf31 commentedon Nov 7, 2016
Oh I see, then no, it's different.
joshuahhh commentedon Dec 13, 2016
[EDIT: This bug is actually an instance of #2481, a different issue.]
I think I've run into this bug. My minimal reproduction is
which produces the error
even though
compiles without error.
Am I covered by this issue, or is this something different?
(Thanks!)
joshuahhh commentedon Dec 13, 2016
OK – I just ran into a second, different bug, which actually uses capital-N Newtype deriving. Minimal reproduction is
which produces the error
even though
compiles without error.
I'm guessing this is the bug referred to by this issue, and the bug I posted yesterday is a different one. Is that right?
(Thanks even more!)
garyb commentedon Dec 13, 2016
The second one is the case that this is for, yep :)
The first one might actually be yet another issue though! As it's for lowercase-n newtype deriving.
LiamGoodacre commentedon Dec 13, 2016
Aren't these all the same issue based around when we replace type synonyms?
garyb commentedon Dec 13, 2016
They fall into that general category yeah. But on the other hand I think we shouldn't normally allow instances for type synonyms, to avoid confusion. So we want them to be desugared for deriving, but not for a hand written instance.
adamw commentedon Dec 17, 2016
Just hit the same thing (https://groups.google.com/forum/#!topic/purescript/HG7uiRChNhE). I suppose the same argument as why instances for functionally-dependent record types are allowed would apply to type synonyms?