Skip to content

Conversation

Qqwy
Copy link

@Qqwy Qqwy commented Jun 12, 2024

I had a few conversations with @fdedden during and after ZuriHack about the possibility of adding instances of the Struct class for user-defined datatypes with less boilerplate, potentially using Generics.

Furthermore, the separate instances of the Typed class are no longer necessary if one uses an overlappable instance. (Which is fine, as a type will never be both implementing Struct and be one of the other non-struct types at the same time.)

I thought this should be possible and not terribly difficult, so as I had a little time this evening I gave it a shot.

This PR is not intended to be merged; it is only example code that should give you an idea of how GHC.Generics could be used to accomplish the desired task.

@Qqwy Qqwy force-pushed the qqwy/generic_structs branch from 0e71ca0 to b05e9be Compare June 12, 2024 21:12
@ivanperez-keera
Copy link
Member

Thanks, @Qqwy !

Some elements of this PR have been used to inspire the solution in #566. I'll use the other PR to coordinate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants