Yes, it's possible in principle to add such things to the standard library. However, the rarity with which such a feature is requested provides evidence that it's not important enough to build in! Benjamin Barenblat's suggestions of functional data structures seem good; most applications will be fine using those.

Do you have a particular application in mind?

In general, I think arrays are dramatically overused in programming. They're really a rather poor fit for almost all problems, in terms of programming elegance. Finite maps are more justifiable, but I would claim SQL subsumes them, for computations happening on the server.

On 07/22/2017 11:59 AM, Artyom Shalkhakov wrote:
Hello all,

Is it possible to extend Ur/Web with arrays and maps? It would be
really useful, I guess.

For the time being, Aistis put together a JS-only solution:

https://github.com/sheganinans/js_map

The downside is that this solution exploits some implementation
details of the Ur/Web JS virtual machine (e.g. the fact that all Ur
functions are in a curried form).



_______________________________________________
Ur mailing list
Ur@impredicative.com
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to