Skip to content

Instantly share code, notes, and snippets.

@WimJongeneel
Created October 31, 2020 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WimJongeneel/e3380b8d69e0be2de1e7c33be10e1ef7 to your computer and use it in GitHub Desktop.
Save WimJongeneel/e3380b8d69e0be2de1e7c33be10e1ef7 to your computer and use it in GitHub Desktop.
export const skip_while = <a>(c: Cont<a>, p: (a:a) => boolean) => {
let taking = false
return create_cont(cb => c.run(v => {
if(p(v) == false) taking = true
if(taking) cb(v)
}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment