foldr1 and foldl1 are too restrictive
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 36/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 领域
- backend
调研方向
Start by comparing the proposed and current foldr1 signatures in the issue, then trace their definitions and the corresponding foldl1 implementation in the repository. Check existing tests for these functions and determine whether the proposed terminal-value mapping behavior can be supported without a full traversal; done means the API decision and its behavior are covered by tests. The issue has had no comment activity for over four years.
由索引模型根据 Issue 内容生成。
描述
Should the signature of foldr1 (and similarly foldl1) be:
foldr1 :: forall f a b. Foldable1 f => (a -> b -> b) -> (a -> b) -> f a -> b
I understand the logic behind the current signature:
foldr1 :: forall f a b. Foldable1 f => (b -> b -> b) -> f b -> b
In that, if I have a mapping from a -> b, then I can pre-map unconditionally, and derive the latter signature. Unfortunately that's not actually what I want to do:
- I only want the mapping to apply to the terminal value.
- I want to otherwise combine with the combining function.
- I don't want to waste an entire traversal to make the signature work.
I feel like there's a missed opportunity with the current signature. To be honest, I almost never want the current signature.
- 主要语言
- PureScript
- 星标
- 51
- 派生
- 57
- 平均合并
- 3 天 14 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
purescript/purescript-foldable-traversable 的其他 Issue
-
Add `count`未关闭status: accepted type: enhancement
难度 2/5 1-3 小时 新手友好度 35/100
purescript/purescript-foldable-traversable#140 · 7 条评论 ·
-
type: documentation
难度 2/5 1-3 小时 新手友好度 35/100
purescript/purescript-foldable-traversable#139 · 1 条评论 ·
-
`Data.Traversable` re-exports `sum` from `Data.Foldable` but not `product`可能已有人在做 @triallax 于 1959 天前认领。 未关闭type: enhancement
难度 2/5 1-3 小时 新手友好度 25/100
purescript/purescript-foldable-traversable#137 · 5 条评论 ·
-
foldrM未关闭type: enhancement
难度 3/5 1-2 天 新手友好度 35/100
purescript/purescript-foldable-traversable#136 · 3 条评论 ·
-
purs-0.15 type: breaking change
难度 3/5 1-2 天 新手友好度 25/100
purescript/purescript-foldable-traversable#132 · 4 条评论 ·
查看 purescript/purescript-foldable-traversable 的全部 Issue
相似的 Issue
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOF未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 62/100
ManageIQ/manageiq-pods#1476 ·
维护者通常 1 天内回复
-
mcp: typed tool handlers lose wrapped JSON-RPC errors可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
modelcontextprotocol/go-sdk#1529 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
FinanceFlash/unvibecode#818 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100