Skip to content

Instantly share code, notes, and snippets.

@hughfdjackson
Created October 28, 2011 14:52
Show Gist options
  • Save hughfdjackson/1322462 to your computer and use it in GitHub Desktop.
Save hughfdjackson/1322462 to your computer and use it in GitHub Desktop.
Monad?
function colorScheme(r, g, b){
return function(callback){
return callback(r, g, b)
}
}
function darken(darken_by){
return function(r, g, b){
return colorScheme(r - darken_by, g - darken_by, b - darken_by)
}
}
var MyColor = colorScheme(50, 50, 100)
var Darker = MyColor(darken(10))
Darker(function(r, g, b){ console.log(r, g, b) })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment