#4282: Data.List.intersperse not lazy enough
----------------------------------+-----------------------------------------
    Reporter:  daniel.is.fischer  |       Owner:                       
        Type:  proposal           |      Status:  new                  
    Priority:  normal             |   Component:  libraries/base       
     Version:  6.12.3             |    Keywords:  intersperse, laziness
    Testcase:                     |   Blockedby:                       
          Os:  Unknown/Multiple   |    Blocking:                       
Architecture:  Unknown/Multiple   |     Failure:  Other                
----------------------------------+-----------------------------------------

Comment(by maeder):

 Does the following implementation gain something?
 {{{
 intersperse :: a -> [a] -> [a]
 intersperse s l = case l of
   [] -> l
   x : r -> x : case r of
     [] -> r
     _ -> s : intersperse s r
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4282#comment:2>
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