-
-
Save WimJongeneel/0e3c86a7d54a9727d5871487aadf4086 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const take_until = <a>(c: Cont<a>, p: (a:a) => boolean) => { | |
let taking = true | |
return create_cont(cb => c.run(v => { | |
if(p(v) == true) taking = false | |
if(taking) cb(v) | |
})) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment