Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

compute expressions out of order, like `where` or `let` blocks in haskell

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example
Octocat-spinner-32 test
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 README.markdown
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README.markdown

disorder

Compute expressions out of order, like where or let blocks in haskell.

You could also think of this library as flow control for synchronous code.

build status

example

var disorder = require('disorder');

var vars = disorder({
    x : function (y, f, z) { return z * f(y + 1) },
    y : function (z) { return z * 2 },
    z : 5,
    f : function (y) { return function (n) { return y * n } },
});
console.dir(vars);

output:

{ z: 5, y: 10, f: [Function], x: 550 }

methods

var disorder = require('disorder')

disorder(exprs)

Given an object of variable expressions exprs that maps names to function expressions or constants, return an object that solves the dependency graph, if possible.

Each expression can be a constant value or a function to express a dependant value. To specify dependencies, use the variable expression name in the arguments list.

install

With npm do:

npm install disorder

license

MIT

Something went wrong with that request. Please try again.