
Hi, 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. Greetings, Joachim -- Joachim "nomeata" Breitner mail@joachim-breitner.de | nomeata@debian.org | GPG: 0x4743206C xmpp: nomeata@joachim-breitner.de | http://www.joachim-breitner.de/