Re: [Ur] Default settings using a generic record update

2019-12-11 Thread Mark Clements
r :). fun update_ab [write] (sub : Subset.t [A = int, B = int] write) (w : $write) = Subset.set {A = 1, B = 2} w fun update_ab [write] (sub : Subset.t [A = int, B = int] write) (w : $write) = Subset.over (fn _ => w) {A = 1, B = 2} Hope that helps! Best, Ziv On Fri, Dec 6, 2019 at 10:20 AM Mark C

Re: [Ur] Default settings using a generic record update

2019-12-06 Thread Mark Clements
75c865133%7Cbff7eef1cf4b4f32be3da1dda043c05d%7C0%7C0%7C637079604764027387=RDT9vPh4qegdK9iiBr%2F2K7vpFc4z%2BF2y4cHa2eDe5Tw%3D=0> (It relies on another module, Eq, from the same project.) Ziv On Tue, Oct 29, 2019 at 11:21 Mark Clements mailto:mark.cleme...@ki.se>> wrote: Adam: thank you for

Re: [Ur] Ur/Web -> JavaScript objects

2019-10-16 Thread Mark Clements
(* ?? *) (fn [nm ::_] [t ::_] [rest ::_] [[nm] ~ rest] t acc => acc -- nm ++ {nm = t}) base fl update Any guidance would be appreciated. Kindly, Mark. On 8/10/19 10:57 pm, Adam Chlipala wrote: > On 10/6/19 5:45 PM, Mark Clements wrote: >> In defining an FFI to

Re: [Ur] Ur/Web -> JavaScript objects

2019-10-16 Thread Mark Clements
uld be very nice if we as a community were to come up with a "batteries included" library for Ur/Web. ср, 16 окт. 2019 г. в 10:55, Mark Clements mailto:mark.cleme...@ki.se>>: Adam: that is very cool -- thank you. All: as a noob question, I can update a record using: {A=1,B=2,C=3} ---

Re: [Ur] Default settings using a generic record update

2019-10-29 Thread Mark Clements
) : $(keep ++ change) = update {A=1, B=1} args (* or *) fun defaultSetting [keep] [change] [keep ~ change] (args : $change) : $(keep ++ change) = {A=1,B=1} --- change ++ args -- Mark On 29/10/19 12:52 am, Adam Chlipala wrote: > On 10/28/19 3:27 PM, Mark Cleme

[Ur] Default settings using a generic record update

2019-10-28 Thread Mark Clements
I would like to set defaults for a JavaScript library within Ur/Web. I have the following code that fails on the last line: can anyone suggest how to make defaultSetting more generic, please? Kindly, Mark. fun update [keep] [change] [keep ~ change] (xs : $(keep ++

[Ur] Utility objectifyUr function in JavaScript

2019-10-28 Thread Mark Clements
Dear all, I found that the following function is very useful for converting Ur/Web data structures within JavaScript. This may be useful to others -- although has it been implemented elsewhere? Kindly, Mark. var urNewKeyMap = {typ : "type"}; function objectifyUr(urValue, newKeyMap) {

[Ur] Unable to use d3.js library

2019-09-25 Thread Mark Clements
In developing an FFI for the rmath standalone library (https://github.com/mclements/urweb-rmath), I wanted to plot some values. I was able to get urweb-canvas going (very nice) and SVG [1], but it would be nice to use some pre-existing libraries for axes, labels, etc. As an initial approach, I

[Ur] Ur/Web -> JavaScript objects

2019-10-06 Thread Mark Clements
One aspect that I appreciate about Ur/Web is that the xml tags define keys and types that can /potentially/ be included in a tag - that is, a tag does but not need to include all of the keys. In defining an FFI to a JavaScript library such as Chart.js, config options may be defined in terms of

Re: [Ur] angelflow

2020-09-29 Thread Mark Clements
Could someone confirm that this is not spam, please? I realise that angelflow has posted to this list before, but I don't like clicking on random URLs. Kindly, Mark. On 29/9/20 7:22 am, angelflow wrote: ur