Proposal: adding 'tailDropWhile' to Data.List
Kazu Yamamoto ( 山本和彦 )
kazu at iij.ad.jp
Wed Sep 28 11:44:11 CEST 2011
Hello Ivan,
> I don't think that "chop" is a very good name for this kind of
> function; by the name, I would think more a function of type Int ->
> [a] -> [[a]] that "chops up" a list into sub-lists of size n. "strip"
> (which I presume is what you meant as your second suggestion) is a bit
> better...
I didn't propose to add 'chop'. I proposed to add 'tailDropWhile'.
> For this kind of textual task, you _really_ should be using text
> anyway, and this function is already implemented for you:
> http://hackage.haskell.org/packages/archive/text/0.11.1.5/doc/html/Data-Text-Lazy.html#v:stripEnd
For real use, you are right. But to teach list programming to
beginners, I think this is necessary. For instance, I would explain
how to process String without regular expressions.
--Kazu
More information about the Libraries
mailing list