#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 Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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 20 months 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 http://www.haskell.org/haskellwiki/Library_submissions for details)?

Note: See TracTickets for help on using tickets.