How to use the sanctuary.joinWith 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 / async.js View on Github external
(err, results) => {
        if (err == null) exit0 (S.joinWith ('') (results)); else exit1 (err);
      }
    );
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 xodio / hm-def / src / signature.js View on Github external
const lookupTypeClass = tcm => tcName => {
  const tc = tcm[tcName];
  if (!tc) {
    const allTypeClasses = S.pipe ([S.keys, S.joinWith (', ')]) (tcm);
    throw new TypeError (`Type class ${tcName} not found. Available type `
      + `classes are: ${allTypeClasses}`);
  }

  return tc;
};
github plaid / async-problem / synchronous.js View on Github external
const main = () => {
  const path = join (process.argv[2]);
  S.pipe ([path,
           readFile,
           S.lines,
           S.map (path),
           S.map (readFile),
           S.joinWith (''),
           exit0])
         ('index.txt');
};
github plaid / async-problem / callbacks.js View on Github external
readFile (path (file)) ((err, data) => {
        if (err != null) exit1 (err);
        $results[idx] = data;
        filesRead += 1;
        if (filesRead === filenames.length) exit0 (S.joinWith ('') ($results));
      });
    });