Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: cef9f9d650
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (35 sloc) 0.859 kb

sigsolve

type signature satisfiability solver under function composition

build status

example

var test = require('tap').test;
var sigsolve = require('sigsolve');

var pool = {
    f : [ 'a', 'b' ],
    g : [ 'b', 'x' ],
    h : [ 'x', 'z' ],
    i : [ 'c', 'z' ],
    j : [ 'c', 'd' ],
};

var solutions = sigsolve([ 'a', 'z' ], pool);
console.dir(solutions);

output:

[ [ 'f', 'g', 'h' ] ]

methods

var sigsolve = require('sigsolve')

sigsolve(target, pool)

Given a type signature target and an object pool mapping function names to type signatures,

return an array of function chain arrays that when composed have the same type signature as the target.

license

MIT/X11

Jump to Line
Something went wrong with that request. Please try again.