Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support types with type parameters #12

Open
davegurnell opened this issue Aug 2, 2018 · 3 comments
Open

Support types with type parameters #12

davegurnell opened this issue Aug 2, 2018 · 3 comments
Assignees

Comments

@davegurnell
Copy link
Owner

We need to support them, I guess!

@pvillega
Copy link
Collaborator

pvillega commented Oct 7, 2018

So I added some tests on top of the PR for first class ADT (#17) but I am missing some piece of knowledge regarding Shapeless to make this really work.

We already support cases like Class[String] where the parameter is defined and can be replaced in the members of the case class.

For types like Class[A] we get a diverging implicit error unless we define an implicit Typeable for A. But, if we do that, A becomes a value like String on the cod generation

Now, Elm (not sure about Flow/others) would support something like type alias Class a = { param: a } but I am not sure how to make Shapeless understand there is an A there, and to propagate it in a way we can use it.

I need help, senpai :)

@pvillega
Copy link
Collaborator

To extend on the note above, as far as I can see Shapeless Generic1 would manage types with type parameters, but all the examples I see they only seem to work with Traits, which could be a problem for our use case (if that limitation is correct)

For example for Elm we can have Records that use a type parameter, but that would need to be a case class as the record needs parameters in it. With a trait we probably can't map things across correctly.

It may be that this is not relevant as (talking about Elm here) Records may be used more often with reusable front-end code, not with Json coming from the server.

@pvillega
Copy link
Collaborator

Sorry, going through all my alerts and open issues, and I'm noticing some which are several years old 😓 I stopped using Elm years ago, and I am not even sure if I can find the time to do this now. I'll remove myself from assignee.

@pvillega pvillega removed their assignment Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants