Hilbert curve: Difference between revisions
m
→JS Functional
m (→JS Functional) |
m (→JS Functional) |
||
Line 1,817:
return Boolean(n) ? (
take(n)(iterate(go)(seed))
.slice(-1)[0]
) : seed;
};
Line 1,917 ⟶ 1,918:
// iterate :: (a -> a) -> a -> Gen [a]
const iterate = f =>
// An infinite list of repeated applications
//
function* (x) {
let v = x;
Line 1,962 ⟶ 1,963:
xs => ys => {
const
as = take(
bs = take(
return Array.from({
length:
}, (_, i) => f(as[i], bs[i]));
};
|