converting capital letters into small letters
Andy Moran
moran@galois.com
Fri, 26 Jul 2002 08:52:03 -0700
Andrew J Bromage wrote:
> G'day all.
Avagoodweekend.
> On Fri, Jul 26, 2002 at 01:27:48AM +0000, Karen Y wrote:
> > 1. How would I convert capital letters into small letters?
> > 2. How would I remove vowels from a string?
>
> As you've probably found out, these are very hard problems.
i agree, and I also agree that Haskell hasn't got it quite right. Luckily=
for=20
us, this problem has been around for a while now, and a solution may be f=
ound=20
in a C library, known as "ctype.h". It provides this function:
int tolower(int c);
So with a little foreign import magic, and a bit of map (details left to=20
reader), we're golden! Caveat: this doesn't necessarily work for Unicode=
,=20
but it's a start. And you've got to stay within the IO monad. But them'=
s=20
the breaks.
As for removing vowels, instead of proposing a solution, I choose to disp=
ute=20
that the problem needs solving and claim victory.
Cheers,
Andy
--=20
Andy Moran Ph. (503) 526 34=
72
Galois Connections Inc. Fax. (503) 350 08=
33
3875 SW Hall Blvd. http://www.galois.c=
om
Beaverton, OR 97005 moran@galois.c=
om