Should `localeCompare` return in `Effect`?
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 领域
- api
调研方向
Review Data.String.Common.localeCompare and the linked MDN localeCompare behavior, then compare them with the planned Intl bindings that accept a Locale argument. The issue is done only after the FFI/effect decision and intended API behavior are resolved; no file or test is named in the report.
由索引模型根据 Issue 内容生成。
描述
localeCompare can return different output depending on locale. Example borrowed from MDN:
console.log("ä".localeCompare("z", "de")); // a negative value: in German, ä sorts before z
console.log("ä".localeCompare("z", "sv")); // a positive value: in Swedish, ä sorts after z
The FFI for Data.String.Common.localeCompare uses the system default locale, so Data.String.Common.localeCompare "ä" "z" could be LT or GT depending on if it's run in Germany or Sweden, for example.
It seems unlikely (maybe even impossible? I'm not sure) for a system's locale to change over the lifetime of a program, so maybe that is enough to consider localeCompare observationally pure?
I'm mostly just curious about the intuition for what makes FFI code "effect"-ful, as I have a library of bindings for the Intl object and I was planning on adding to it a localeCompare that accepted the Locale argument as well.
- 主要语言
- PureScript
- 星标
- 57
- 派生
- 76
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
purescript/purescript-strings 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 35/100
purescript/purescript-strings#176 · 6 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
purescript/purescript-strings#171 · 3 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 45/100
purescript/purescript-strings#170 ·
-
难度 3/5 1-2 天 新手友好度 38/100
purescript/purescript-strings#167 · 4 条评论 ·
-
难度 5/5 一周以上 新手友好度 30/100
purescript/purescript-strings#164 · 2 条评论 ·
查看 purescript/purescript-strings 的全部 Issue
相似的 Issue
-
Bug
难度 2/5 1-3 小时 新手友好度 75/100
Automattic/safe-publish#593 ·
-
area/plugin
难度 2/5 1-3 小时 新手友好度 75/100
kestra-io/plugin-kestra#190 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
pending-maintainer-response pending-triage
难度 2/5 1-3 小时 新手友好度 75/100