function-lift
Lifts functions into the given context: promise, list, maybe, etc.
Motivation
This tool is heavily inspired by Haskell and the functional programming concept. The main idea of lifting is to abstract away the application control flow in some well-known patterns: .then() in case of promises, for example, or if (x !== undefined)). This ability makes code clean, pure and far more reusable.
Features
- Allows functions to operate on monadic values
- Supports any function arity
Installation
npm install function-lift
Usage
var lift = ; { ...} { ...} var promisify = ; var multiply = ; var log = ; // Now we can write asynchronous code in synchronous manner; // Or mix synchronous and asynchronous values without using any callbacks or .then();;; // I always wanted to do this:var myNumber = $;var result = ;