Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
|------------------------------------------------------------------------------
| Fantasy Land
|------------------------------------------------------------------------------
*/
// RemoteData Applicative
RemoteData[FL.of] = RemoteData.of;
RemoteData.prototype[FL.of] = RemoteData.prototype.of;
// RemoteData Chain
RemoteData[FL.chain] = RemoteData.chain;
RemoteData.prototype[FL.chain] = RemoteData.prototype.chain;
// RemoteData Functor
RemoteData[FL.map] = RemoteData.map;
RemoteData.prototype[FL.map] = RemoteData.prototype.map;
// RemoteData Apply
RemoteData[FL.ap] = RemoteData.ap;
RemoteData.prototype[FL.ap] = RemoteData.prototype.ap;
// RemoteData Semigroup
RemoteData[FL.concat] = RemoteData.concat;
RemoteData.prototype[FL.concat] = RemoteData.prototype.concat;
module.exports = RemoteData;
*
* getStreetNumber({}).withDefault('No Address') // 'No Address'
*
* @class Maybe
* @memberof module:Zoom.Data
*/
// Maybe Applicative
Maybe[FL.of] = Maybe.of;
// Maybe Chain
Maybe[FL.chain] = Maybe.chain;
Maybe.prototype[FL.chain] = Maybe.prototype.chain;
// Maybe Functor
Maybe[FL.map] = Maybe.map;
Maybe.prototype[FL.map] = Maybe.prototype.map;
// Maybe Apply
Maybe[FL.ap] = Maybe.ap;
Maybe.prototype[FL.ap] = Maybe.prototype.ap;
// Just Applicative
Maybe.Just[FL.of] = Maybe.Just.of;
Maybe.Just.prototype[FL.of] = Maybe.Just.prototype.of;
// Maybe.Just Chain
Maybe.Just[FL.chain] = Maybe.Just.chain;
Maybe.Just.prototype[FL.chain] = Maybe.Just.prototype.chain;
// Maybe.Just Functor
import FL from 'fantasy-land';
import Task from './Task';
// Task Applicative
Task[FL.of] = Task.of;
Task.prototype[FL.of] = Task.prototype.of;
// Task Chain
Task[FL.chain] = Task.chain;
Task.prototype[FL.chain] = Task.prototype.chain;
// Task Functor
Task[FL.map] = Task.map;
Task.prototype[FL.map] = Task.prototype.map;
export default Task;
/*
|------------------------------------------------------------------------------
| Fantasy Land
|------------------------------------------------------------------------------
*/
// Validation Applicative
Validation[fl.of] = Validation.of;
Validation.prototype[fl.of] = Validation.prototype.of;
// Validation Chain
Validation[fl.chain] = Validation.chain;
Validation.prototype[fl.chain] = Validation.prototype.chain;
// Validation Functor
Validation[fl.map] = Validation.map;
Validation.prototype[fl.map] = Validation.prototype.map;
// Validation Apply
Validation[fl.ap] = Validation.ap;
Validation.prototype[fl.ap] = Validation.prototype.ap;
// Validation Semigroup
Validation[fl.concat] = Validation.concat;
Validation.prototype[fl.concat] = Validation.prototype.concat;
// Validation Monoid
Validation[fl.empty] = Validation.empty;
Validation.prototype[fl.empty] = Validation.prototype.empty;
// Success Applicative
/*
|------------------------------------------------------------------------------
| Fantasy Land
|------------------------------------------------------------------------------
*/
// Result Applicative
Result[fl.of] = Result.of;
// Result Chain
Result[fl.chain] = Result.chain;
Result.prototype[fl.chain] = Result.prototype.chain;
// Result Functor
Result[fl.map] = Result.map;
Result.prototype[fl.map] = Result.prototype.map;
// Result Apply
Result[fl.ap] = Result.ap;
Result.prototype[fl.ap] = Result.prototype.ap;
// Ok Applicative
Result.Ok[fl.of] = Result.Ok.of;
Result.Ok.prototype[fl.of] = Result.Ok.prototype.of;
// Err Applicative
Result.Err[fl.of] = Result.Err.of;
Result.Err.prototype[fl.of] = Result.Err.prototype.of;
module.exports = Result;
/*
|------------------------------------------------------------------------------
| Fantasy Land
|------------------------------------------------------------------------------
*/
// Result Applicative
Result[fl.of] = Result.of;
// Result Chain
Result[fl.chain] = Result.chain;
Result.prototype[fl.chain] = Result.prototype.chain;
// Result Functor
Result[fl.map] = Result.map;
Result.prototype[fl.map] = Result.prototype.map;
// Result Apply
Result[fl.ap] = Result.ap;
Result.prototype[fl.ap] = Result.prototype.ap;
// Ok Applicative
Result.Ok[fl.of] = Result.Ok.of;
Result.Ok.prototype[fl.of] = Result.Ok.prototype.of;
// Err Applicative
Result.Err[fl.of] = Result.Err.of;
Result.Err.prototype[fl.of] = Result.Err.prototype.of;
};
/*
|------------------------------------------------------------------------------
| Fantasy Land
|------------------------------------------------------------------------------
*/
// Tuple Applicative
Tuple[fl.equals] = Tuple.equals;
Tuple.prototype[fl.equals] = Tuple.prototype.equals;
// Tuple Functor
Tuple[fl.map] = Tuple.map;
Tuple.prototype[fl.map] = Tuple.prototype.map;
module.exports = Tuple;
import FL from 'fantasy-land';
import Either from './Either';
// Either Applicative
Either[FL.of] = Either.of;
// Either Chain
Either[FL.chain] = Either.chain;
Either.prototype[FL.chain] = Either.prototype.chain;
// Either Functor
Either[FL.map] = Either.map;
Either.prototype[FL.map] = Either.prototype.map;
// Either Apply
Either[FL.ap] = Either.ap;
Either.prototype[FL.ap] = Either.prototype.ap;
// Right Applicative
Either.Right[FL.of] = Either.Right.of;
Either.Right.prototype[FL.of] = Either.Right.prototype.of;
// Either.Right Chain
Either.Right[FL.chain] = Either.Right.chain;
Either.Right.prototype[FL.chain] = Either.Right.prototype.chain;
// Either.Right Functor
it('should support Functor specification', function() {
const a = RA.Identity.of(1);
assert.isTrue(RA.isFunction(a[fl.map]));
});
[fl.map](...args) {
return functorTrait[fl.map].call(this, ...args);
}