build
This commit is contained in:
parent
06ebcfff89
commit
174c0135ac
5 changed files with 1987 additions and 8 deletions
1916
docs/_snowpack/link/repl/krill-parser.js
Normal file
1916
docs/_snowpack/link/repl/krill-parser.js
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -292,20 +292,40 @@ class Pattern {
|
|||
outerJoin() {
|
||||
return this.outerBind(id);
|
||||
}
|
||||
_patternify(func) {
|
||||
const pat = this;
|
||||
const patterned = function(...args) {
|
||||
const pat_arg = sequence(...args);
|
||||
return pat_arg.fmap((arg) => func.call(pat, arg)).outerJoin();
|
||||
};
|
||||
return patterned;
|
||||
}
|
||||
_fast(factor) {
|
||||
var fastQuery = this.withQueryTime((t) => t.mul(factor));
|
||||
return fastQuery.withEventTime((t) => t.div(factor));
|
||||
}
|
||||
fast(factor) {
|
||||
return this._patternify(Pattern.prototype._fast)(factor);
|
||||
}
|
||||
_slow(factor) {
|
||||
return this._fast(1 / factor);
|
||||
}
|
||||
slow(factor) {
|
||||
return this._patternify(Pattern.prototype._slow)(factor);
|
||||
}
|
||||
_early(offset) {
|
||||
offset = Fraction(offset);
|
||||
return this.withQueryTime((t) => t.add(offset)).withEventTime((t) => t.sub(offset));
|
||||
}
|
||||
early(factor) {
|
||||
return this._patternify(Pattern.prototype._early)(factor);
|
||||
}
|
||||
_late(offset) {
|
||||
return this._early(0 - offset);
|
||||
}
|
||||
late(factor) {
|
||||
return this._patternify(Pattern.prototype._late)(factor);
|
||||
}
|
||||
when(binary_pat, func) {
|
||||
var true_pat = binary_pat._filterValues(id);
|
||||
var false_pat = binary_pat._filterValues((val) => !val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue