Skip to content

Instantly share code, notes, and snippets.

@craigdallimore
craigdallimore / sort.md
Last active January 27, 2022 20:34
VSC sort vs Vim sort

VSC Line Sort Order

Using command palette > Sort Lines Ascending

1.63.2 (Universal)

stop
STOP
stopping
stopSearch
@craigdallimore
craigdallimore / series-future.js
Created October 9, 2016 13:12
Series future example
// mkFuture
// :: Any next
// -> Any prev
// -> Future next
let mkFuture = next => prev => Future((reject, resolve) => {
console.log(`start: ${prev},${next}`);
setTimeout(() => {
console.log(`resolve: ${prev},${next}`)
@craigdallimore
craigdallimore / parallel-future.js
Last active October 9, 2016 13:46
Parallel future example
let mkFuture = v => Future((reject, resolve) => {
console.log(`start: ${v}`);
setTimeout(() => {
console.log(`resolve: ${v}`)
resolve(v);
}, Math.random() * 1000);
});
// A function that takes a number and returns a Promise for nothing but
// some logging side effects.
const vow = num => new Promise(resolve => {
console.log(`start ${num}`);
setTimeout(() => {
console.log(`done ${num}`);
resolve();
}, Math.random() * 500);
});

Transduce


What is transduce? What is it for? This document is intended to help people (such as myself) who would be looking through the ramda docs, find transduce and have no idea if it would be a good fit for my current problem.