Rewrite of Data.Char library?

Ahn, Ki Yung kyagrd at
Thu Oct 22 21:22:37 EDT 2009

In the #haskell IRC channel, we just had a discussion on Data.Char
predicates such as isAlpha, isUpper, isLower.  The implementation of
Data.Char is not Haskell 98 since Char specification in Haskell 98 only
covers latin1.  However, current predicates are confusing and intuitive
properties does not hold.  One example is this:

[17:53:32] <newsham> > let cs = [minBound..maxBound]; us = filter
isUpper cs; ls = filter isLower cs in take 5 $ (map toUpper ls) \\ us
[17:53:33] <lambdabot>   "\170\186\223I\312"

isLower '\170' == True  but you can't turn that into an uppercase
letter.  isUpper '170' == '\170'.

I know that GHC team working on a rewrite of IO library for better
Unicode support (I hope also includes better locale and charset
support).  Along the line to the new IO library work, it would also be
good to have some cleanup in the Data.Char as well.


Ahn, Ki Yung

More information about the Libraries mailing list