String != [Char]

Greg Weber greg at gregweber.info
Mon Mar 26 19:26:11 CEST 2012


Can the unicode experts here propose a Text API whose functions work
for all Unicode (start by removing list functions)? If there is such a
satisfactory API and it does not conflict with the Prelude we could
use it unqualified.

On Mon, Mar 26, 2012 at 10:21 AM, Johan Tibell <johan.tibell at gmail.com> wrote:
> On Mon, Mar 26, 2012 at 10:12 AM, Ian Lynagh <igloo at earth.li> wrote:
>> I am very unicode-ignorant, so apologies if I have misunderstood
>> something, but doesn't Text do the same thing?
>>
>> Prelude T> import Data.Text.IO as T
>> Prelude T T> T.putStrLn (T.take 5 (T.pack "Fro\x0308hßen"))
>> Fröh
>>
>> Maybe your point is that neither "take" function should be used with
>> unicode strings, but I don't see how advocating the Text type is going
>> to help with that.
>
> We already covered this. Text inherited a list-based API, even if that
> sometimes doesn't make sense.
>
> To work with Unicode you need more specific functions for different
> tasks. Text only implements a few so far, like case conversion and
> case-less comparison, and asks you to use text-icu for the rest.
>
> -- Johan
>
> _______________________________________________
> Haskell-prime mailing list
> Haskell-prime at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-prime



More information about the Haskell-prime mailing list