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

AsData type delegates its schema instance implementation to its non-AsData counterpart. #5877

Closed
wants to merge 1 commit into from

Conversation

Unisay
Copy link
Contributor

@Unisay Unisay commented Apr 4, 2024

Better way of defining HasSchema instance as explained here.

@michaelpj
Copy link
Contributor

And the test itself should change to no longer import the type from Blueprints.Lib, rigth?

@Unisay Unisay added the No Changelog Required Add this to skip the Changelog Check label Apr 4, 2024
@Unisay
Copy link
Contributor Author

Unisay commented Apr 4, 2024

And the test itself should change to no longer import the type from Blueprints.Lib, rigth?

bummer:
image

the reason is that type-level (TF-driven unrolling of nested types) flattening is not driven by the HasSchema instance (its not enough), but it requires a Generic instance to work, but the AsData types don't have it...

@michaelpj
Copy link
Contributor

Ugh. Then this is rather pointless. I don't see why it can't be driven by the HasSchema instances - indeed it seems like the instance head in this case tells us the nested types, but whatever.

@Unisay
Copy link
Contributor Author

Unisay commented Apr 4, 2024

Ugh. Then this is rather pointless. I don't see why it can't be driven by the HasSchema instances - indeed it seems like the instance head in this case tells us the nested types, but whatever.

If only I knew about this difficulty with AsData in the beginning I wouldn't use the TF/Generic-based derivation machinery, I'd employ heavier gun (Template Haskell) 🤷🏼‍♂️

@Unisay Unisay closed this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Changelog Required Add this to skip the Changelog Check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants