Fwd: Types and Generics

---------- Forwarded message ---------
From: Dimitre Novatchev <dnovatchev@gmail.com>
Date: Mon, Nov 30, 2020 at 7:03 AM
Subject: Re: Types and Generics
To: Michael Kay <mike@saxonica.com>, Adam Retter <adam.retter@exquery.org>,
Christian Grün <christian.gruen@gmail.com>
Cc: Dimitre Novatchev <dnovatchev@gmail.com>


 >  But a fully worked specification (including, in particular, all the
type subsumption rules)
> is something that I don't have the energy (or probably the brain-power)
for.

Could you, please expand on this? Any examples of the "type subsumption
rules" ?

What do other developers / implementors think? @Christian Grün
<christian.gruen@gmail.com>  @Adam Retter <adam.retter@exquery.org> ?

Thanks,
Dimitre

On Mon, Nov 30, 2020 at 2:48 AM Michael Kay <mike@saxonica.com> wrote:

> I've wondered about this; and internally, at a very simple level, Saxon
> does have something a bit like this where we know, for example, that the
> result of fn:reverse is the same type as the input. But a fully worked
> specification (including, in particular, all the type subsumption rules) is
> something that I don't have the energy (or probably the brain-power) for.
>
> Michael Kay
> Saxonica
>
> On 30 Nov 2020, at 01:30, Dimitre Novatchev <dnovatchev@gmail.com> wrote:
>
> Isn't it time to introduce generics?
>
>
> fn:group-by($seq as $$T*,
>
>             $fun as function($arg as $$T  ) as $$V)
>         as map($$V, $$T+)
>
> Applies $fun on each of the items in $seq and groups the results by
> value, in a  map with an entry for each distinct produced value $v  (as
> key) and value - the sequence of all items $it in $seq such that $fun($it)
> eq $v
>
>
> Thanks,
> Dimitre
>
>
>
>

Received on Monday, 30 November 2020 15:46:11 UTC