Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS 尾递归优化 #4

Open
yhm-amber opened this issue Sep 30, 2023 · 1 comment
Open

TS 尾递归优化 #4

yhm-amber opened this issue Sep 30, 2023 · 1 comment

Comments

@yhm-amber
Copy link
Contributor

yhm-amber commented Sep 30, 2023

把 List 也变成 lacking 的。如何?

ref: https://cs3110.github.io/textbook/chapters/ds/sequence.html

无非是多一个 Done ,相对于迭代器。迭代器则是没有 Done 。仅此而已。

迭代器的方法自成,列表的方法则全都依赖折叠。

以及,列表有 reduce 而迭代器没有。迭代器也没有普通的折叠,而是类似于 scan 的。

列表的 reduce 基于列表的折叠,迭代器的 scan 基于迭代器的折叠。这里的两种基于形式不同。

@yhm-amber yhm-amber changed the title 惰性化计划 惰性化 List Sep 30, 2023
@yhm-amber
Copy link
Contributor Author

不了。

https://cs3110.github.io/textbook/chapters/hop/fold.html

问题改为如何达成在 TS 的尾递归优化。

@yhm-amber yhm-amber changed the title 惰性化 List TS 尾递归优化 Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant