Skip to content

Instantly share code, notes, and snippets.

@Munksgaard
Last active November 28, 2025 22:16
Show Gist options
  • Select an option

  • Save Munksgaard/5ba228cef5368f6d39a326b0eb966dd6 to your computer and use it in GitHub Desktop.

Select an option

Save Munksgaard/5ba228cef5368f6d39a326b0eb966dd6 to your computer and use it in GitHub Desktop.
fn unpipe(f: fn(a) -> b, g: fn() -> a) -> b {
f(g())
}
pub fn inc_and_reverse(xs: List(Int)) -> List(Int) {
use <- unpipe(list.reverse)
use x <- list.map(xs)
x + 1
}
> foo:inc_and_reverse([1,2,3,4]).
[5,4,3,2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment