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

farrow-module 是否有基于函数版本的实现? #59

Open
zhanglingkang opened this issue Mar 26, 2021 · 3 comments
Open

farrow-module 是否有基于函数版本的实现? #59

zhanglingkang opened this issue Mar 26, 2021 · 3 comments

Comments

@zhanglingkang
Copy link

如题,蟹蟹~~

@github-actions
Copy link

Thank feedback. We will check it later:-)

@Lucifier129
Copy link
Collaborator

从 runtime 机制上,可以有函数的版本,但写法会复杂一点。

从 type 层面,一旦涉及递归,目前的 TS,函数版本的 type infer 不奏效,TS 要求明确标注返回值。

class 版本,TS 有特殊处理,class 定义时,既包含 impl 实现,又包含 type 声明,可以支持递归关联。

函数版本,如果要保持 immutable,也很难实现递归引用。

总的来说,函数式的方式实现 farrow-module 可能是一个全新的思路和考量。现阶段还没有很清晰的想法。

@zhanglingkang
Copy link
Author

了解了,感谢回复~

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

2 participants