Skip to content

Instantly share code, notes, and snippets.

@irskep
Created February 19, 2016 18:39
Show Gist options
  • Save irskep/df36edc1bda9caddc200 to your computer and use it in GitHub Desktop.
Save irskep/df36edc1bda9caddc200 to your computer and use it in GitHub Desktop.
# reasonable language
let x = myList
.map({
mapFunc($0)
})
.filter({
filterFunc($0)
})
.reduce(0, {
$0 + $1
})
# Python
let x = reduce([mapFunc(y) for y in myList if filterFunc(mapFunc(y)], 0, lambda a, b: a + b)
# WHAT EVEN IS CONTROL FLOW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment