Haskell Platform Proposal: add the 'text' library
igloo at earth.li
Sun Nov 7 10:46:54 EST 2010
On Sat, Nov 06, 2010 at 03:34:16PM +0000, Ian Lynagh wrote:
> On Sun, Oct 17, 2010 at 01:25:52PM -0700, Bryan O'Sullivan wrote:
> > cousins. For instance, breakSubstring is descriptive, and it's consistent
> > with bytestring, but it's much longer than break, even though breaking on a
> > fixed string is more common. In this case, length and frequency of use trump
> > the other considerations in my mind.
> I grepped the reverse deps of text looking for uses of text's break, to
> see what it was being used for, but didn't find any uses. It's possible
> I missed some in the noise, though (e.g. there are quite a lot of calls
> to Prelude's break; we really need tibbe's tool for this).
Duncan asked me about split and find. Again, human error could well be a
factor here, but I found 2 uses, both of which could equally well use
the Char version:
where words = ["*S1*", "*S2*"] ++ (T.split " " sentence) ++ ["*E1*", "*E2*"]
mconcat $ map makeTrigrams $ T.split "." $ T.pack sentences
Also interesting is this, from MissingH-184.108.40.206/src/Data/List/Utils.hs:
> split "," "foo,bar,,baz," -> ["foo", "bar", "", "baz", ""]
> split "ba" ",foo,bar,,baz," -> [",foo,","r,,","z,"]
split :: Eq a => [a] -> [a] -> [[a]]
I found no uses of find.
More information about the Libraries