Opened 3 years ago

Closed 3 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):


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 3 years ago by igloo

  • difficulty set to Unknown
  • Resolution set to wontfix
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.