-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
A type level equivalent of the with
keyword
#1378
Comments
Does this also mean that we probably want a typelevel version of |
Can you give a code example that shows what the proposal would look like? |
The primary driver of this request is that the types in https://github.com/jcouyang/dhall-aws-cloudformation/ are sometimes out of date, or AWS's own definitions are incorrect, and we need to overwrite the type of a single (possibly nested) field. This means we cannot use Given a type Additionally, a type-level version of |
Makes sense to me. |
Yeah, this seems like a reasonable request |
The Record types are always distinct from record values, already at the level of syntax. Do we actually need separate operators like Right now Dhall has separate operators Should we simplify the design of Dhall and have just one set of operations that works both for record types and record values? |
I think something |
I think it would be okay to combine |
Should the Currently:
|
I think so, and there's actually already an issue for that, too: #1079 |
I'd say, we should go through the entire records / unions syntax to see if things can be simplified. I could do that given time. |
When interacting with a library that may not have the most ergonomic types, a useful escape hatch is to overwrite fields using
with
. This gets unwieldy very quickly, though, when I need to reach for a function likeList/Map
to apply this same transformer items in a list; you need to supply the input and output types as arguments to the function. If i'm decorating/changing an existing type, the only thing I know to do here is infer the new decorated type with the compiler, and then paste that definition as an argument to List/Map. Ifwith
had a type level equivalent, the type-level and term-level implementations would match and this would be much more ergonomic.The text was updated successfully, but these errors were encountered: