Public
Edited
Mar 28, 2024
2 stars
Also listed in…
ReqAck
Insert cell
Insert cell
brick = g => (a, b) =>
a.map((e, i) => ((i === 0)
? g('|', a[0], b[0])
: g('~ & |', b[i], a[i], b[0]))()
).concat(b[0])
Insert cell
brick1 = grender(g => {
g({}, brick(g)(
[g()()],
[g()()]
))({capacity: 1})(g())
})
Insert cell
brick2 = grender(g => {
const [a, b] = [0, 1].map(_ => g({}, g()()))
g({}, brick(g)(
[a(), a()],
[b(), b()]
))({capacity: 1})(g())
})
Insert cell
brick3 = grender(g => {
const [a, b] = [0, 1].map(_ => g({}, g()()))
g({}, brick(g)(
[a(), a(), a()],
[b(), b(), b()]
))()(g())
})
Insert cell
recBrick = g => {
const gbrick = brick(g)
return inp => {
const rec = n => (n === 0) ? [inp()] : gbrick(rec(n - 1), rec(n - 1))
return rec
}
}
Insert cell
lzc = g => t => {
const w = t.state.label.width
const ww = Math.log2(w)
const nres = recBrick(g)(g({}, t))(ww)
return g({}, nres)({width: nres.length})
}
Insert cell
lzc4 = grender(g => lzc(g)(g()({width: 4}))(g()))
Insert cell
lzc8 = grender(g => lzc(g)(g()({width: 8}))(g()))
Insert cell
lzc16 = grender(g => lzc(g)(g()({width: 16, capacity: 1}))(g()))
Insert cell
lzc32 = grender(g => lzc(g)(g()({width: 32}))(g()))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more