Does anyone want intersperse for Data.Sequence?
David Feuer
david.feuer at gmail.com
Mon Dec 22 11:03:22 UTC 2014
containers master now uses a new mechanism to implement <*> that can
also be used directly to implement an efficient intersperse function
corresponding to the one in Data.List. The real question is whether
anyone wants one. The potential for clashing names is obviously a
point against. The other is that the same asymptotic bounds (but
almost certainly worse constant factors) can be obtained using
intersperse x xs = drop 1 $ forwards $ Backwards (fromList [const x,
id]) <*> Backwards xs
More information about the Libraries
mailing list