if(embedStylesPrinted != true) {document.write('');}var embedStylesPrinted = true;var content = '
function type(obj) {
this.is = function(type) {
return typeof obj === type;
};
this.is_object = function() {
return typeof obj === "object";
};
this.is_func = function() {
return typeof obj === "function";
};
this.is_string = function() {
return typeof obj === "string";
};
};
var maybe = function(item) {
var __internal = item;
this.result = function(accessor, __default) {
if (!__internal) {
return new type(accessor).is_func() ? __default : accessor;
}
return new type(accessor).is_func() ? accessor(__internal) : __internal;
};
this.select = function(accessor) {
if (!__internal) {
return new maybe(null);
}
if (new type(accessor).is_string()) {
return new maybe(__internal[accessor]);
}
else {
return new maybe(accessor(__internal));
}
};
};