fix appWhole / appBoth

This commit is contained in:
Felix Roos 2022-02-12 23:54:45 +01:00
parent a0c09f7575
commit 8d81458b7f

View file

@ -275,10 +275,10 @@ class Pattern {
// resolve wholes, applies a given pattern of values to that // resolve wholes, applies a given pattern of values to that
// pattern of functions. // pattern of functions.
const pat_func = this const pat_func = this
query = function(span) { const query = function(span) {
const event_funcs = pat_func.query(span) const event_funcs = pat_func.query(span)
const event_vals = pat_val.query(span) const event_vals = pat_val.query(span)
apply = function(event_func, event_val) { const apply = function(event_func, event_val) {
const s = event_func.part.intersection(event_val.part) const s = event_func.part.intersection(event_val.part)
if (s == undefined) { if (s == undefined) {
return undefined return undefined
@ -293,7 +293,7 @@ class Pattern {
appBoth(pat_val) { appBoth(pat_val) {
// Tidal's <*> // Tidal's <*>
const whole_func = function(span_a, span_b) { const whole_func = function(span_a, span_b) {
if (span_a == undefined || span_B == undefined) { if (span_a == undefined || span_b == undefined) {
return undefined return undefined
} }
return span_a.intersection_e(span_b) return span_a.intersection_e(span_b)