@typed-f/functor
Version:
[![NPM Version][functor-npm-version-badge]][functor-npm] [repo-circleci-badge]: https://img.shields.io/circleci/project/github/Ailrun/typed-f/master.svg?logo=circleci [![Known Vulnerabilities][functor-snyk-badge]][functor-snyk] [![Supported TypeScript Ver
16 lines (15 loc) • 508 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var Functor;
(function (Functor) {
function map(f) {
return function (wa) {
if ('map' in wa) {
return wa.map(f);
}
//tslint:disable-next-line: max-line-length
throw new Error('Parameter is not a functor. You cannot call the function map with non-functor.');
};
}
Functor.map = map;
})(Functor = exports.Functor || (exports.Functor = {}));