Notification: adding adjust' to Data.Sequence (rage on!)
David Feuer
david.feuer at gmail.com
Wed Jun 29 22:48:46 UTC 2016
This is not a proposal. I know that for reasons I don't know, the decision
was made to move extra-strict functions for the other containers into
separate .Strict modules. I greatly dislike the result of that decision
(both from the API standpoint and especially from a maintenance
standpoint), but I'm not arguing to change that.
However, I am adding an extra-strict function to Data.Sequence, with the
following non-negotiable semantics:
adjust' f i xs =
case xs !? i of
Nothing -> xs
Just x -> let !x' = f x in update i x' xs
This will provide an efficient way to adjust a sequence element without
risking thunk chains and memory leaks.
I'm sure some people will be angry. I just wanted to make sure no one says
I snuck this in behind their back.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160629/617b23fb/attachment-0001.html>
More information about the Libraries
mailing list