This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function generator() { | |
| return { | |
| [Symbol.iterator]() { return this }, | |
| scope(step) { | |
| this.$step = step | |
| return this | |
| }, | |
| yld(value, step) { | |
| this.value = value; | |
| this.$step = step; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function* agen() { | |
| for(let i = 0; i < 1000;i++) { | |
| yield i | |
| yield i+1 | |
| } | |
| } | |
| function* wrap(s) { | |
| for(const i of s) { | |
| yield 3*i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function* generator() { | |
| for(let i = 0; i < 10000;i++) { | |
| yield i | |
| yield i+1 | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as M from "@effectful/es-rt/opts/defunct-inline"; | |
| function generator() { | |
| var generator = M.generator(); | |
| generator.next = generator_1; | |
| generator.$step = 0; | |
| return generator; | |
| } | |
| function generator_1(p) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as M from "@effectful/es-rt/opts/defunct-inline"; | |
| function generator() { | |
| var generator = M.generator(); | |
| generator.next = generator_1; | |
| generator.$step = 0; | |
| return generator; | |
| function generator_1(p) { | |
| switch (generator.$step) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as M from "@effectful/es-rt/opts/inline"; | |
| function generator() { | |
| var generator = M.generator(); | |
| generator.$step = generator_1; | |
| return generator; | |
| function generator_1() { | |
| generator.$step = generator_2; | |
| generator.value = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as M from "@effectful/es-rt"; | |
| function generator() { | |
| var generator = M.generator(); | |
| return generator.scope(generator_1); | |
| function generator_1() { | |
| return this.yld(1, generator_2); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function* generator() { | |
| yield 1; | |
| yield 2; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function* stopThread(input) { | |
| for await(const i of input) { | |
| yield i | |
| if (i.type === "drop" || i.type === "dragcancel" || i.type === "remove") | |
| break | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function* animRemove(input) { | |
| for await(const i of input) { | |
| if (i.type === "remove") { | |
| const el = i.element | |
| const box = el.getBoundingClientRect() | |
| for await(const j of anim()) { | |
| el.style.width = `${box.width*(1-j)}px` | |
| el.style.height = `${box.height*(1-j)}px` | |
| el.style.top = `${box.y+window.pageYOffset+box.height*j/2}px` | |
| el.style.left = `${box.x+window.pageXOffset+box.width*j/2}px` |