Re: [xsl] Looking for a shorter mapping expression

Subject: Re: [xsl] Looking for a shorter mapping expression
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 05 Dec 2004 11:47:20 +0000
>>>>> "Dimtre" == Dimtre Novatchev <dnovatchev@xxxxxxxxx> writes:

    >> How about:
    >> 
    >> f:a ($pFun, $pList)
    >> 
    >> :-) :-) :-)
    >> 
    >> I don't understand the compactness requirement.


    Dimtre> It can be very essential -- if the "/" operator allowed an
    Dimtre> arbitrary sequence on the left, then it would be
    Dimtre> preferrable to f:map()

    Dimtre> But I'm not satisfied at all with the currently (un)
    Dimtre> available ways to define the type of such higher order
    Dimtre> operators in XPath2.

Don't you mean XSLT 2.0

    Dimtre> Compare to the strict type definition in Haskell:

    Dimtre>         map :: (a -> b) -> [a] -> [b]


I see what you mean - for f:map you currently have:

    
    <xsl:function name="f:map" as="item()*">
      <xsl:param name="pFun" as="element()"/>
      <xsl:param name="pList1" as="item()*"/>

whereas what you want is:

    
    <xsl:function name="f:map" like="pList1">
      <xsl:param name="pFun" as="element()"/>
      <xsl:param name="pList1" as="item()*"/>

which is not valid XSLT 2.0.
And I guess it's probably too late to have such a proposal considered.
-- 
Colin Paul Adams
Preston Lancashire

Current Thread