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
There are currently no strict fold operations (except for the Foldable instances ofc) in this package. Would it be worthwhile to add strict variants of the different folds that are provided (like foldrU, foldlU)? Or is there any particular reason to not include them?
Regarding the implementation, they could just be implemented like the default definitions of foldr' and foldl'.
The text was updated successfully, but these errors were encountered:
Yes. For min-queues, we want foldlAsc' and foldrDesc'. For max-queues, we want foldlDesc' and foldrAsc'. For all queues, we want foldlU' and possibly foldrU'. (Of course, we'll also want the WithKey versions.)
The current documentation for the unordered folds makes it pretty silly to have both left and right-handed versions. Obeying the documentation, we could define foldlWithKeyU f = foldrWithKeyU (\k a b -> f b k a). We really should either:
Have foldrU and foldlU' only, or
Have all the unordered folds, but document a specific relationship between the orderings they use. For example, we might want to specify that reverse . foldrU (:) [] = foldlU (flip (:)) []. I think I prefer this option.
There are currently no strict fold operations (except for the Foldable instances ofc) in this package. Would it be worthwhile to add strict variants of the different folds that are provided (like
foldrU
,foldlU
)? Or is there any particular reason to not include them?Regarding the implementation, they could just be implemented like the default definitions of
foldr'
andfoldl'
.The text was updated successfully, but these errors were encountered: