How to use the sanctuary.compose function in sanctuary

To help you get started, we’ve selected a few sanctuary examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plaid / async-problem / kgo.js View on Github external
const main = () => {
  const dir = process.argv[2];

  kgo
  ('index', readFile('utf8', join(dir, 'index.txt')))
  ('filePaths', ['index'], kgo.sync(S.compose(R.map(join(dir)), S.lines)))
  ('files', ['filePaths'], R.partial(foreign.parallel, [readFile('utf8')]))
  ('concated', ['files'], kgo.sync(R.join('')))
  (['concated'], data => {
    process.stdout.write(data);
    process.exit(0);
  })
  (['*'], err => {
    process.stderr.write(String(err) + '\n');
    process.exit(1);
  });
};
github plaid / async-problem / righto.js View on Github external
const concatFiles = path => {
  const readFileRel = S.compose (readFile) (path);
  const index = readFileRel ('index.txt');
  const files = righto.sync (S.compose (S.map (readFileRel)) (S.lines), index);
  return righto.sync (S.joinWith (''), righto.all (files));
};
github plaid / async-problem / righto.js View on Github external
const concatFiles = path => {
  const readFileRel = S.compose (readFile) (path);
  const index = readFileRel ('index.txt');
  const files = righto.sync (S.compose (S.map (readFileRel)) (S.lines), index);
  return righto.sync (S.joinWith (''), righto.all (files));
};
github Risto-Stevcev / lazy-either / src / either.js View on Github external
val = result
      resolveIfDone()
    })
  })
}

LazyEither.prototype['fantasy-land/equals'] = function(other, resolve) {
  this._value(res => {
    other._value(S.compose(resolve, S.equals(res)))
  })
}

LazyEither.lift  = f => R.pipe(f, LazyEither.Right)
LazyEither.liftN = (n, f) => R.curryN(n, R.pipe(f, LazyEither.Right))

LazyEither.promote = S.compose(LazyEither, S.T)

module.exports = { LazyEither: LazyEither }