[Haskell-cafe] unicode text libraries

Duncan Coutts duncan.coutts at googlemail.com
Mon Sep 28 13:01:37 EDT 2009


On Mon, 2009-09-28 at 18:32 +0200, Johan Tibell wrote:
> On Mon, Sep 28, 2009 at 6:15 PM, Don Stewart <dons at galois.com> wrote:
> > tittoassini:
> >> 2009/9/28 Don Stewart <dons at galois.com>:
> >> > titto:
> >> >> Hi,
> >> >>
> >> >> I am looking for an unicode strings  library, I found on hackage:
> >> >>
> >> >> http://hackage.haskell.org/package/compact-string
> >> >>
> >> >> http://hackage.haskell.org/package/text
> >> >>
> >> >> They both look solid and functionally complete so ... I don't know which
> >> >> one to use :-)
> >> >>
> >> >> As I am sure I am not the first one facing this choice, may I ask
> >> >> which one you preferred and why?

> Also, I don't think that a Unicode type should mention what encoding
> it uses as it's an implementation detail.

I would put it more strongly. The encoding should not be in the API
because it makes it harder to compose functionality. While there may be
some circumstances where for performance reasons you may want precise
control over the internal encoding, that is not appropriate to use in
component interfaces. I know we've made this worse recently, but a
proliferation of different string types makes it harder to reuse code.
An exposed encoding parameter makes that even worse.

Duncan



More information about the Haskell-Cafe mailing list