Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Add and derive Deep class#7

Closed
paf31 wants to merge 1 commit into
masterfrom
phil/deep
Closed

Add and derive Deep class#7
paf31 wants to merge 1 commit into
masterfrom
phil/deep

Conversation

@paf31

@paf31 paf31 commented Feb 26, 2017

Copy link
Copy Markdown
Contributor

The idea here is to obviate the need for the old generics implementation and deriving.

This is still a work in progress, but it works for everything except records. I think if we want to go this route, then we should

  • combine the two libraries back into purescript-generics
  • deprecate this one
  • make a major release of generics
  • remove old generic deriving from the compiler.

Thoughts?

@matthewleon

Copy link
Copy Markdown
Contributor

Question: Are there uses for Deep other than compatibility with non-GHC style generics? In other words, if I am writing a new library, is it an option I should look at?

@paf31

paf31 commented Feb 26, 2017

Copy link
Copy Markdown
Contributor Author

@matthewleon That is the main use case, and I'm not sure if it's worth it to be honest. I don't think there is anything you can do with generics that you can't do with generics-rep (this PR is sort of a proof of that 😄)

@paf31

paf31 commented Feb 26, 2017

Copy link
Copy Markdown
Contributor Author

I actually do have one use case which would work with old-style generics, but not with new-style generics, which is to reflect a generic signature as an actual type with a Generic instance.

So this PR is a proof that every type with a generics-rep instance also has an old Generic instance, but not the other way round, and when we're creating types at runtime, that's what we care about.

@JordanMartinez

Copy link
Copy Markdown
Contributor

Should this PR be closed?

@hdgarrood

Copy link
Copy Markdown
Contributor

I think this hasn’t had enough interest to justify inclusion in core, yeah.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants