mirror of
https://github.com/github/semantic.git
synced 2024-12-26 08:25:19 +03:00
Map over dictionaries.
This commit is contained in:
parent
ff21b7d299
commit
c5c9e8838b
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user