Proposal: adding 'tailDropWhile' to Data.List
mail at joachim-breitner.de
Wed Sep 28 12:58:50 CEST 2011
Am Mittwoch, den 28.09.2011, 19:14 +0900 schrieb Kazu Yamamoto:
> > If you still want to use this to teach students (maybe because you're
> > building them up to "but in general you shouldn't do this") then
> > provide this function for their use elsewhere (either as something to
> > copy/paste, or an auxiliary library for your class). But I don't
> > think it belongs in Data.List.
> So, what about 'reverse'?
> Both 'reverse' and 'tailDropWhile' are inefficient.
> Data.List has 'reverse'. Why not 'tailDropWhile'?
also, it’s performance is not too bad, and definitely not as bad as
reverse: If tailDropWhile is implemented in a way that allows list
fusion (should be possible, I think), and I know that the suffix is not
large (e.g. stripping at most trailing "\n"), then tailDropWhile should
be ok to use.
Joachim "nomeata" Breitner
mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C
xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: This is a digitally signed message part
More information about the Libraries