You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementations of foldl'Bits and foldr'Bits look efficient. The implementations of foldlBits and foldrBits, on the other hand, don't look efficient for their purposes. I'd expect foldlBits to look more like foldr'Bits, and I'd expect foldrBits to look more like foldl'Bits.
The text was updated successfully, but these errors were encountered:
foldrBits !prefix f z = go
where
go 0= z
go bm = f (prefix + bi) $ go (bm `xor` bitmask)
where!bitmask = lowestBitMask bm
!bi = indexOfTheOnlyBit bitmask
treeowl
added a commit
to treeowl/containers
that referenced
this issue
Jul 18, 2019
`foldrBits` was previously defined just like `foldr'Bits`, and
`foldlBits` was defined just like `foldl'Bits`. That is, each of them
built up an accumulator, lazily, across a whole leaf before producing
anything. Swap that around so the folds can process values promptly.
Fixeshaskell#666
The implementations of
foldl'Bits
andfoldr'Bits
look efficient. The implementations offoldlBits
andfoldrBits
, on the other hand, don't look efficient for their purposes. I'd expectfoldlBits
to look more likefoldr'Bits
, and I'd expectfoldrBits
to look more likefoldl'Bits
.The text was updated successfully, but these errors were encountered: