Type declarations: Constructor functions? #1506
Labels
Discussion
A discussion on a general topic.
Enhancement
A change or improvement to an existing feature
XQuery
An issue related to XQuery
I’ve tagged this as a discussion issue:
Would it make sense to declare constructor functions for the new XQuery type declarations, similar to what we now have for records, or do we believe that’s over the top?
It might improve typing in complex code, and it would allow us to write things like:
For the type above, an implicit constructor function would be created that would simply coerce its argument to the declared type:
One current drawback is that this only works for prefixed types (see #657), whereas it’s possible to define types without prefix, and reference them in local type declarations:
The text was updated successfully, but these errors were encountered: