[Haskell-beginners] Is there an "unscan" function?

David Virebayre dav.vire+haskell at gmail.com
Thu Jan 12 08:22:13 CET 2012

2012/1/12 David Virebayre <dav.vire+haskell at gmail.com>:
> 2012/1/12 Kyle Murphy <orclev at gmail.com>:
>> I was able to build something incredibly convoluted that accomplishes what
>> you want, but I'm sure there's a better way to do it.
> Not sure if it's a better way.

Disregard that reply, I overlooked the question. My only excuse is
that it's early in the morning.

that would be :

unscan f l = if null l then [] else head l : zipWith f l (tail l)

David. Where's my coffee ! Silly me. I don't drink coffee.

More information about the Beginners mailing list