This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
A common use case for maps is to represent composite structures such as the result of fn:random-number-generator, which is a map containing number: an xs:double next: a function permute: a function The problem about using maps for such structures is that we can't describe or constrain their type very accurately: this example simply becomes map(xs:string, item()). We could introduce tuple types simply as new syntax for constraining the type of a map. declare function fn:random(...) as tuple{number : xs:double, next : function(*), permute : function(item()*) as item()*} The instances of this type would still be maps, and they would still be instances of map(xs:string, item()), and one could use all the same operations (e.g. random($seed)?permute($x)), but the new item type syntax would allow the required type to be specified more descriptively and precisely, and would allow better static type checking. The feature has been prototyped in Saxon: see http://dev.saxonica.com/blog/mike/2016/09/tuple-types-and-type-aliases.html (In this particular example it would be nice to be able to make the type recursive, since the "next" function also returns tuples of this type; but that's a separate requirement).