Haskell Platform Proposal: add the 'text' library

John Lato jwlato at gmail.com
Tue Oct 19 10:22:55 EDT 2010

> From: Roman Leshchinskiy <rl at cse.unsw.edu.au>
> On 17/10/2010, at 21:25, Bryan O'Sullivan wrote:
> > On Mon, Oct 11, 2010 at 1:12 PM, Malcolm Wallace <malcolm.wallace at me.com>
> wrote:
> >
> > The breakSubstring functionality is semantically:
> >    breakSubstring x = break (==x)
> > although there may be a more efficient implementation.
> > Proposal: rename Text.break to Text.breakSubstring, and Text.breakBy to
> Text.break.
> >
> > So far, I've been proceeding on the basis that I'd like naming to be
> consistent and descriptive, and to have more commonly used functions get
> shorter names than their less commonly used (but possibly more general)
> 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.
> FWIW, I take almost exactly the opposite approach with vector. I try to
> follow the list/array interface as closely as possible even in the presence
> of more frequently used but subtly different operations. My rationale is
> that typing a few extra characters is vastly preferable to having to search
> through the docs to find out what this particular library calls this
> particular function.

I think there's a significant difference between vector and text, namely a
Vector is conceptually the same as a list/1D array, while a Text is not.  I
think this difference is enough to warrant a break from the list API.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20101019/aa8765e5/attachment.html

More information about the Libraries mailing list