WIP - Createing an Either impl to avoid try/catch all over the place, especially in the filesystem services.

An Either is an object that can be either a Left value or a Right value. Convention restricts Left to hold error/failure values, and Right for success values. Eithers get really cool when you start to use their methods, like fold(applyToLeft, applyToRight), which applies the left function to the value the Either holds if it is a left, and vice versa if it is a Right. In addition to fold, an Either can be converted into a Right- or Left- Projection of itself, allowing the use of methods like map, flatmap, get, getOrElse, every, and exist. LeftProjections execute HOFs on contained Left instances, and RightProjections on Right instances.

This allows you to not know what type of Either you have in other functions, but apply conditionally executed logic as if you did know by projecting the instance to the type you want:

    var errorableOperation = getFileAsEither('myfile');
    var writeToFile = function(file){ file.write('somedata');}
    errorableOperation
	.right
	.map(writeToFile)
	.left
	.foreach(function(error){console.warn(error)}).map(...)...;

There are also some utility functions included: left(someValue) produces a new Left wrapping someValue, right(someValue) produces a new Right wrapping someValue, conditionalToEither(boolean, rightValue, leftValue) returns a Right wrapping rightValue if boolean is true, a left wrapping leftValue if boolean is false. It has a twin, negationToEither, that returns a Left wrapping leftvalue if boolean is true, and a Right wrapping rightValue if boolean is false.

Eithers are nice containers for objects that can be one of two values, like success and failure. Not every failure is an error, and some can be recovered. You can get the value out of an either by using get() method. You can convert an either to an array (so you can map and flatten it, for example), by calling merge on the either. You can conditionally get a value from a left/right by using the joinRight/joinLeft values, which return either a value or an either containing a value if the either isn't right or isn't left, respectively.

Either's are collection/container types, so you can foreach (side effecting), every, and exists them. They are also mappable to booleans via isRight() or isLeft().