#7203: Add scanl'
------------------------------+---------------------------------------------
 Reporter:  nh2               |          Owner:                  
     Type:  feature request   |         Status:  new             
 Priority:  normal            |      Component:  libraries/base  
  Version:  7.7               |       Keywords:  scanl           
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown      |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------
 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.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7203>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to