Why is foldl1 'not generalized to foldable?

The title says it all. foldl1 and foldl' both generalized to Foldable , and foldl1' are not. Is this just recent control? Or is it a design choice?

Type foldl1' -

 foldl1' :: (a -> a -> a) -> [a] -> a 

I expected it to be of the same type as foldl1 :

 foldl1 :: Foldable t => (a -> a -> a) -> ta -> a 

I also see that foldl1' exported by Data.List , but not Data.Foldable . Perhaps this is related?

+7
haskell fold typeclass
source share
1 answer

Perhaps a generalized form simply would not have a good place to live ? There may also have been some of the performance considerations, but I could not find any information about this.

0
source share

All Articles