[email protected] wrote:
My initial (non-compiling) attempts were something along the lines of:fun list2p s = case s of Nil => <xml/> | (h::t) => <xml><p>{[h]}</p>{[list2p t]}</xml>
You should change {[list2p t]} to {list2p t}, since this is a piece of XML, not a value of another type that must be _converted_ to XML. Also, you'll get compiler errors about undetermined type variables (or something related) if the later context of use of 'list2p' doesn't determine which tag the output of your function belongs inside.
BTW, most of this logic is already implemented in the standard library as a higher-order function. See List.mapX.
_______________________________________________ Ur mailing list [email protected] http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
