-
Notifications
You must be signed in to change notification settings - Fork 210
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
Generate parametrized types to inject into evaluation context #2520
Comments
There is not a good way to do this using the Haskell API, as far as I can tell. |
@Gabriella439 I was thinking a bit yesterday about this. I'm not sure what those "annotations" are for that I see sprinkled around, but maybe we can add annotation which tell us if this particular type was introduced by a type variable e.g.
So, when I use a dummy type with I haven't worked with generics in a while, so I'm not sure if their API exposes enough information though. Anyway, great library and language. I really like it. |
I want to have certain types available in my evaluation context. From the substitutions tutorial that's easy enough for simple types, and I can even use something like this
declared $ inject @MySumType
to generateExpr Src Void
value of my type.However, if I have a bit more complex type that has a type parameter, I can't use the
ToDhall
instance and have to manually write the typeExpr
.Is there perhaps something that could help with this, or do I have to do it manually?
This is a bit cumbersome to write and maintain, especially if I have a lot of fields:
The text was updated successfully, but these errors were encountered: