TypeCell, open source TypeScript notebooks live programming environment
typecell.org
typecell.org
for (let i = 0; i < 10;|) {}
^ cursor(no, I'm not kidding: https://www.npmjs.com/package/halting-problem)
type Lazy<A> = () => A;
const lazy = <A,>(f: Lazy<A>) => {
let thunk: Lazy<A> = () => { throw null; }
thunk = () => {
const y = f();
thunk = () => y
return y;
};
return thunk;
};
const tap = <A,B>(f: Lazy<(a: Lazy<A>) => Lazy<B>>, a: Lazy<A>): Lazy<B> =>
lazy(() => f()(a)());
const ap = (f: any, a: any): any => tap<any,any>(f, a);
const y = <A,>(f : (a: Lazy<A>) => Lazy<A>): Lazy<A> => ap(((x: any) => ap(ap(f, x), x)),((x: any) => ap(ap(f,x),x)));
type Cat = {
name: string,
friend: Cat,
prefersDryFood: boolean,
foodPerWeek: number
};
export const cat = y<Cat>(self => lazy(() => ({
name: "lol",
friend: self(),
prefersDryFood: false,
foodPerWeek: 4,
})))();
Breaks typescript though. Also, the laziness won't work here. return thunk;
with: return () => thunk();
Otherwise the assignment in thunk does nothing.They own VSCode and TypeScript. No one is better positioned to make such a product.
> Something went wrong: TypeError: Cannot read properties of null (reading 'useRef')
Appears to be an issue with the charting library used here at a glance?
Well... presses Ctrl-Shift-i ...I found an easier way to run some code :)
[0]: https://vadosware.io/post/the-future-of-free-and-open-source...
I use Quokka.js but I hate that the free version is almost useless