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

Better type error on un-data-encodable records #809

Open
SeungheonOh opened this issue Feb 1, 2025 · 0 comments
Open

Better type error on un-data-encodable records #809

SeungheonOh opened this issue Feb 1, 2025 · 0 comments

Comments

@SeungheonOh
Copy link
Collaborator

data PFoo (s :: S) = PFoo
  { foo :: Term s (PAsData (PBuiltinList Crypto.PPubKeyHash))
  }

Current, above compiles fine with DeriveAsDataStruct because strategy actually don't check if each field is PIsData. Instead, it checks to see if PInnerMost of each fields are PData. This is to reduce requiring PIsData constraint on every polymorphic types. Technically, it is fine as it is. Since there's no instance PIsData (PBuiltinList Crypto.PPubKeyHash), it is impossible to construct such value altogether.

But, I'd like to have this fail on compilation for better UX

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

No branches or pull requests

1 participant