curry some functions. massaman or panang?

This commit is contained in:
Rowan 2025-04-16 22:34:46 -05:00
parent 628d0ef80b
commit 484502213e

View file

@ -18,7 +18,7 @@ export const maybe = curry(
return result.isOk() ? result : succeed([], original)
})
export const not = parser => state => {
export const not = curry((parser, state) => {
const result = parser(state)
if (result.isOk()) {
@ -26,13 +26,13 @@ export const not = parser => state => {
} else {
return succeed([], state)
}
}
})
export const until = parser => state => {
export const until = curry((parser, state) => {
let result = ok(state)
while (result.isOk()) {
const [original, clone] = fork(state)
const [original, clone] = result.chain(fork)
result = result.chain(x => parser(clone))
if (result.isOk()) {
break
@ -42,7 +42,7 @@ export const until = parser => state => {
}
return result
}
})
export const skip = curry((parser, state) => {
})