Skip to content

Instantly share code, notes, and snippets.

@asbjornenge
Created November 21, 2013 21:56
Show Gist options
  • Save asbjornenge/7590436 to your computer and use it in GitHub Desktop.
Save asbjornenge/7590436 to your computer and use it in GitHub Desktop.
So, is this a monad?
// _* implementations go here. They all return a list of locations.
var MapMonad = function(locations) {
return {
fit : function(map) { return MapMonad(_fit(locations, map)); },
sprinkle : function(map) { return MapMonad(_sprinkle(locations, map)); },
mark : function(map) { return MapMonad(_mark(locations, map)); },
hide : function() { return MapMonad(_hide(locations)); },
filter : function(fn) { return MapMonad(_filter(fn)); },
locations : locations
}
};
// So, is this a monad ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment