Skip to content

Instantly share code, notes, and snippets.

@uriee
Last active August 29, 2015 14:14
Show Gist options
  • Save uriee/d6456f67086f7772a871 to your computer and use it in GitHub Desktop.
Save uriee/d6456f67086f7772a871 to your computer and use it in GitHub Desktop.
The Domain Object
var contain = function(arr,val);
var domain = function(arr,coTo,morphisem) {
return function(){
var values = arr || [];
return {
morph : function(func){
return domain(values.map(func));
},
morphTo : function(domain,morphisem){
var codomain = values.map(morphisem);
var domval = domain.getValues()
var res = codomain.reduce(function(a,b){
console.log(a,b,codomain,b in domval,domval);
if (b in domval) return a;
else return a.concat(b)
},[])
console.log(res);
if(res) return false; else return true;
},
getValues : function(){
return values;
}
}
}()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment