Does anyone want intersperse for Data.Sequence?

Niklas Hambüchen mail at nh2.me
Tue Dec 30 00:41:09 UTC 2014


Coming back to your original question:
I don't see any real points against adding it:

1. Name clashes

Data.Sequence exports functions like `reverse`, `zip`, `length`, many
more.
That's an indicator to me that its API, like Data.Vector's, is meant
to be imported qualified.

2. "It has same asymptotics but a better constant factor than X"

How's that a point against?

+1

On 22/12/14 12:03, David Feuer wrote:
> 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