inits

Aaron Denney wnoise at ofb.net
Mon Apr 10 11:50:54 EDT 2006


On 2006-04-10, Simon Marlow <simonmarhaskell at gmail.com> wrote:
> Spencer Janssen wrote:
>> Earlier today on the #haskell IRC channel, Tim Toorop (bolrod on
>> #haskell) pointed out that Data.List.inits is rather slow, and
>> proposed an alternative.  After some collabrative tweaking, we came up
>> with the following:
>> 
>> 
>>>inits xs = [] : (zipWith take [1..] $ map (const xs) xs)
>
> I propose to replace inits in Data.List with this one.

Woo!

-- 
Aaron Denney
-><-



More information about the Libraries mailing list