Fix sometimes (#1243)

* test and fix for sometimes bug
This commit is contained in:
Alex McLean 2025-01-16 11:18:33 +00:00 committed by GitHub
parent d5ab391a98
commit 00b0341839
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 7 deletions

View file

@ -499,7 +499,7 @@ export const undegrade = register('undegrade', (pat) => pat._undegradeBy(0.5), t
export const sometimesBy = register('sometimesBy', function (patx, func, pat) {
return reify(patx)
.fmap((x) => stack(pat._degradeBy(x), func(pat._undegradeBy(1 - x))))
.fmap((x) => stack(pat._degradeBy(x), func(pat)._undegradeBy(1 - x)))
.innerJoin();
});