Documentation: Array.tryPick code example gives an error
维护者通常 3 天内回复
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 78/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- fsharp
调研方向
有问题的示例位于 src/FSharp.Core/array.fsi 中 Array.tryPick 的文档注释里,大约在第 472 行。在 F# Interactive 中运行该代码片段以复现类型错误,然后修正示例,使谓词中的比较返回 bool,例如将条件改为 n > 3 或 n = 0。完成的标准是:修正后的代码片段能够编译并返回预期结果,并且文档注释已相应更新。
由索引模型根据 Issue 内容生成。
描述
let input = [| 1; 2; 3 |]
input |> Array.tryPick (fun n -> if n > 3 = 0 then Some (string n) else None)
n > 3 return a bool. 0 is an int. I got the following error:
This expression was expected to have type
'bool'
but here has type
'int'
Replacing 0 with true worked:
input |> Array.tryPick (fun n -> if n > 3 = true then Some (string n) else None)
- 主要语言
- F#
- 星标
- 4.3k
- 派生
- 881
- 平均合并
- 3 天 20 小时
- 30 天内合并 PR
- 108
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dotnet/fsharp 的其他 Issue
-
Semantic classification cache for opened documents is never populated (written to the unopened-documents cache)可能已有人在做 @xperiandri 于 42 天前认领。 未关闭Needs-Triage
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 3 天内回复
-
Needs-Triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
Bug Needs-Triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
Bug Needs-Triage
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 3 天内回复
-
agentic-workflows
难度 4/5 1-2 天 新手友好度 15/100
维护者通常 3 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
area:docs documentation P3
难度 1/5 1 小时以内 新手友好度 88/100
Raaif-Yousuf/Wingman#837 ·
维护者通常 1 天内回复
-
documentation good first issue hacktoberfest
难度 2/5 1-3 小时 新手友好度 70/100
wassim-azi/agy-powerline#47 ·
维护者通常 1 天内回复
-
area/localization language/es triage/accepted
难度 2/5 1-3 小时 新手友好度 70/100
kubernetes/website#58112 ·
维护者通常 2 天内回复
-
agent:working documentation enhancement go:build lane:needs-decision
难度 2/5 1-3 小时 新手友好度 72/100
Sanne/incus-spawn#1435 · 3 条评论 ·
维护者通常 1 天内回复