Created
November 21, 2013 21:56
-
-
Save asbjornenge/7590436 to your computer and use it in GitHub Desktop.
So, is this a monad?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// _* 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