JSPM

  • Created
  • Published
  • Downloads 117
  • Score
    100M100P100Q72495F
  • License MIT

Package Exports

  • inquiry-monad

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (inquiry-monad) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Inquiry Monad

v0.4.0

Experiment with aggregate Left/Right monad running parallel. More details when it is better fleshed out.

const subject = {
    a: 1,
    b: false
};

Inquiry.of(subject)
    .informant(console.log)
    .inquire(hasA)
    .inquire(retrieveC)
    .inquire(validateB)
    .cohort(x => handleFails(x), y => handlePasses(y));

// result: {subject: {a:1, b:false}, pass: Pass(), fail: Fail()}

Interrogative methods:

inspect informant

Standard monadic methods:

ap map chain

Unwrap methods:

cohort - run functions for both Pass and Fail join - exit and return values of the subject, pass, fail fork - exit and either run a function if there are any failures, or another if all have passes fold - same as fork, opposite order zip - exit and return an merged list of passes and fails

Multi-map method: unison

Flow-control method: swap