-
Notifications
You must be signed in to change notification settings - Fork 17
[generics-rep] Add instances for some usual algebraic types? #43
Comments
The dependency for |
Although perhaps |
@garyb Am I to understand that you are in favour of this undertaking in principle? |
#34 (comment) says:
So I did that in purescript/purescript-either#57 |
@kindaro yeah, it seems reasonable to me - since Deriving the instance in I think if we were to move the |
I like the idea of using the same pattern in all cases, and I also think moving Generic closer to the root of the dependency hierarchy makes sense, for the same reason. I would be in favour of merging this library into |
Yeah, that was what I was thinking - just changing where it resides, not the |
Is this something we should do in 0.14? |
I think so. |
Unless this is likely to be breaking in some way (I don’t think it is?), then I think we should consider postponing it so that we can get the release out sooner. |
So, here's my understanding of what we'd have to change:
The only breaking changes we might make are the names of the modules. Quoting Gary:
and Harry:
Renaming the modules would be a breaking change. If we do not rename them, we could migrate the modules after v0.14.0. If we rename them, we should do it before v0.14.0. Which one should we take? I believe the modules would be renamed to the following:
|
Yes, good point, thanks. I’m not sure why I thought this wouldn’t be breaking. I agree then, now probably is a good time to do it. |
Unit shouldn’t get a Generic instance, incidentally. We should only provide Generic instances when a data type’s constructors are exported. But other than that this all sounds good 👍 I think doing it now and renaming the modules sounds preferable. Moving a module from one library to another is always sort of breaking anyway, because you’ll end up with duplicate module errors if you don’t drop the library where those modules previously lived from your dependencies. |
Things left to do:
Anything else? |
All other PRs pass CI and are ready for review. See above comment for links to them. |
All PRs have been merged. The only thing left to do here is transfer the issues and deprecate this repo. |
Woo-hoo, such progress in such a short time. Thank you Jordan and allies. |
I renamed all issues in this repo, so that they include "[generics-rep] " in front of the original issue. I've transferred all open issues in this repo to There's two pull requests currently open. I'm guessing we should close them and open issues in |
Ok. All PRs have been addressed:
So, I believe the only thing left to do is deprecate this repo. |
As stated above, I believe the only thing left to do is to deprecate this repo. Does someone need to transfer this repo to the |
I haven’t been following closely enough to judge if everything else is ready to go, but I can take care of deprecating this library if so. |
I've moved this library to the |
I think it might be best to wait until after 0.14.0 is released to tell Pursuit that this library has been deprecated, because we want the current version to still appear in search results until then. |
That's a good reason to wait; I'll leave this issue open. |
As I understand from documentation, instances for
Generic
may only be defined in either:Generic
.In the case of
Generic
, the latter two coincide inData.Generic.Rep
.This means that I cannot possibly define an instance of Generic for any type I do not define myself in the first place. This includes all the usual types like
Unit
orEither
. The only instance provided by this package is forMaybe
— this is not enough. I propose that more instances be given.Since generics are such a basic thing, I further propose that the right place to define instances is in the modules that define subject types. This includes the
Maybe
instance — it should be moved away for consistency.The text was updated successfully, but these errors were encountered: