<div dir="auto"><div>I'm okay with moving those things into base. I'm even okay with doing some fancy ad hoc thing with Enum (Enum is a bad joke anyway). But the Generic instance gives me the heeby jeebies. Will it hurt anyone to just derive Generic there? (And both Generic and Generic1 for Generically1?). I'd rather not just omit it, but I think that would be better than this.<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 30, 2019, 4:11 PM Alexis King <<a href="mailto:lexi.lambda@gmail.com">lexi.lambda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> On Aug 30, 2019, at 14:33, David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank" rel="noreferrer">david.feuer@gmail.com</a>> wrote:<br>
> <br>
> I do have two concerns:<br>
> <br>
> 1. The Genetically instances for base classes will need to move to base as well, including auxiliary classes where those are needed.<br>
<br>
Agreed. For context, the existing instances of Generically (apart from the Generic instance, discussed below) are:<br>
<br>
(Generic a, Eq (Rep a ())) => Eq (Generically a)<br>
(Generic a, Ord (Rep a ())) => Ord (Generically a)<br>
(Generic a, GBounded (Rep a)) => Bounded (Generically a)<br>
(Generic a, GEnum StandardEnum (Rep a)) => Enum (Generically a)<br>
(Generic a, GShow0 (Rep a)) => Show (Generically a)<br>
(Generic a, Semigroup (Rep a ())) => Semigroup (Generically a)<br>
(Semigroup a, Generic a, Monoid (Rep a ())) => Monoid (Generically a)<br>
<br>
I think having these in `base` is actually a good thing, since it serves as a good set of examples of how to use GHC.Generics. The current `GEnum` class might be a little too much to include in `base`, but that’s fine: it can be specialized to `GEnum StandardEnum` without breaking backwards-compatibility with `generic-data` (which can continue to provide the more sophisticated implementation).<br>
<br>
> 2. The Generic instance of Generically is currently a custom job. That's really not the greatest situation in general. Is that essential for some reason? If not, I think its Generic instance should just be derived.<br>
<br>
This is an interesting point. Again for context, the current instance is as follows:<br>
<br>
instance Generic a => Generic (Generically a) where<br>
type Rep (Generically a) = Rep a<br>
to = Generically . to<br>
from = from . unGenerically<br>
<br>
Which is to say `Generically` wrappers are invisible from the perspective of the `Generic` class.<br>
<br>
Personally, I think this instance makes sense: think of every instance of some class `C` on `Generically a` is supposed to provide an instance of `C a` in terms of `Generic a`, and that is exactly what `Generic (Generically a)` does. However, it’s obviously a useless instance, since it’s just the identity function on an existing `Generic a` dictionary. In any case, I think it’s harmless, but I can understand why you might think it’s sketchy.<br>
<br>
</blockquote></div></div></div>