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

Jeffrey Thornton jeffreyjthornton at gmail.com
Thu Jan 12 05:44:51 CET 2012


Hello-

Is there standard function in Haskell that effectively does an inverse
scan? For example,

    scanl1 (\ x y -> x+y) [1,2,3,4] == [1,3,6,10].

So is there a very simple built-in way to do this hypothetical example?:

    unscanl1 (\ x y -> y-x) [1,3,6,10] == [1,2,3,4]

Thanks,
Jeffrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20120111/1b26e2ea/attachment.htm>


More information about the Beginners mailing list