haskell / haskell/vector

Add vector version of mapAccumL that behaves like the list version

未关闭
#228 23 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Haskell
星标
400
派生
145
PR 合并指标
30 天内没有已合并 PR

描述

I've implemented a hand rolled version, and another two versions based on a combination of `mapM` and the lazy and strict versions of `State` monad.

https://github.com/haskell-works/hw-prim/pull/38

The benchmarks show that the hand rolled versions run two times faster than the lazy state monad version and 16 times faster than the strict state monad version.

I found the slow performance of the strict monad version most surprising.

I'm aware that the version that using `mapM` might enable fusion, however it is a fair bit slower than a hand rolled version that defeats fusion.

I would love to have a fusion-enabled version that runs as fast as the hand rolled version. Would that be possible?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。