Opened 3 years ago

#12505 new feature request

Add foldl1' to Data.Foldable

Reported by: tserduke Owned by:
Priority: normal Milestone:
Component: libraries/base Version: 8.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

With the change strict Foldable instances could be written in a simple and performant manner:

maximum = foldl1' max
minimum = foldl1' min
sum = foldl1' (+)
product = foldl1' (*)

Also foldl1' from Data.List gets generalized.

Change History (0)

Note: See TracTickets for help on using tickets.