Opened 7 years ago

Closed 7 years ago

#7203 closed feature request (wontfix)

Add scanl'

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


The presence of foldl' and foldl1' suggests the addition of scanl' (and scanl1') to Data.List:

scanl'                   :: (a -> b -> a) -> a -> [b] -> [a]
scanl' f q ls            =  q `seq` (q : (case ls of
                                     []   -> []
                                     x:xs -> scanl' f (f q x) xs))

This would finally sort out the infamous (last . scanl) problem.

Change History (1)

comment:1 Changed 7 years ago by igloo

difficulty: Unknown
Resolution: wontfix
Status: newclosed

Could you please make a proposal on the libraries list (see for details)?

Note: See TracTickets for help on using tickets.