diff --git a/prototype/UI/index.html b/prototype/UI/index.html index 125f14f87..21d8c1065 100644 --- a/prototype/UI/index.html +++ b/prototype/UI/index.html @@ -223,9 +223,13 @@ return this; } - function Leaf(object) { - this.value = object; - return this; + // forall a b. Dictionary String a -> (a -> b) -> Dictionary String b + Dictionary.prototype.map = function(transform) { + var copy = new Dictionary(); + for (key in this.values) { + copy.values[key] = transform(this.values[key]); + } + return copy; } function Syntax(json, continuation) {