Haskell Platform Proposal: add the 'text' library
s.clover at gmail.com
Tue Oct 5 14:50:14 EDT 2010
On Oct 5, 2010, at 2:18 PM, Bryan O'Sullivan wrote:
> On Tue, Oct 5, 2010 at 11:07 AM, Max Bolingbroke <batterseapower at hotmail.com> wrote:
> FWIW I'm also strongly in favour of having name consistency before
> including text in the Platform.
> Well, if that's the consensus, then we're at an impasse, because the libraries process is a trackless mire as has been fairly clearly demonstrated over the past few days, and I'm not going to change the names or types of the text functions. I've got better things to do than slog through such an ungratifying and demoralising morass.
Luckily there's an alternative that involves neither the libraries process or changing the Text API. Instead, we could, as Bryan had suggested prior, simply change the Bytestring API to match that of Text. As has been pointed out, bytestring is not under the direction of the libraries list, but is actively maintained by dons and dcoutts. So if the bytestring maintainers look favorably on matching the Text API, things can be moved along very quickly.
That said, while most of the changes in Text make perfect sense for a character based rather than text based API, and most make sense to move to bytestring, there are the few ones which are pure taste.
Those are, particularly, break vs. breakBy vs. breakSubstring, and find vs. findBy, and span vs. spanBy.
In all those cases, there's an argument that Text makes the "common case" the short one, and this is good. However, break, span, and find are all part of my standard haskell vocabulary. I know their types from Data.List, use them frequently, and think with them. At this point, to change what they mean would lead to a fair amount of frustration and irritation.
Ideally, text could be changed to match bytestring for those functions, bytestring to match text otherwise, and then we could move along to getting text into the platform, which is what we all ultimately want :-)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries