-
Notifications
You must be signed in to change notification settings - Fork 307
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
Implied types for intermediate declarations #200
Comments
@cjllanwarne, IMHO, we could consider it for version 2.0. The type landscape will significantly change after adding structs and directories (and hopefully removing objects). I believe another name for this feature (at least in the ocaml world) is type-inference. It is complicated by generics and sub-typing, which we don't have as of yet, but may wish to add. |
Here's hoping I never hear the phrase "Hindley-Milner" in relation to WDL :P |
On a related note, dxWDL has to figure out variable and expression types, much like the
Currently, I use a local copy of lookupType, but that is not really a good idea. |
I think the OP's example is extreme and it's not very common to encounter such long types. I don't think I'd want to introduce type inference just for this edge case. What about type aliases? For example:
|
I wonder whether this would be a great idea or a terrible one...
A lot of languages allow implied types (ie the language is strongly typed but the author doesn't need to type it out in full - they let the language do that for them).
Here's an example from a recent test case I was writing:
So that intermediate type... it's a bit messy to have to write it out in full (especially since it has to by typed out again in the outputs!).
Suggestion: Let users use
value
as a placeholder instead of the full type for intermediate values. We would still validate any future uses of thevalue
as though it were fully typed, and I would still want full types for inputs and outputs (so that the interface can be read directly from the WDL file):The text was updated successfully, but these errors were encountered: