Does anyone want intersperse for Data.Sequence?

Felipe Lessa felipe.lessa at gmail.com
Mon Dec 22 12:11:39 UTC 2014


On 22-12-2014 09: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

If the name clash is the only downside, I'm +1.  That intersperse
definition isn't obvious :).

Cheers,

-- 
Felipe.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141222/c7647d93/attachment.sig>


More information about the Libraries mailing list