View Single Post
Old Apr 14th, 2007, 9:30 AM   #6
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by Mad_guy View Post
Thanks for the tip. On the second piece of code though, you can't directly convert a Word8 to a Char.
I did wonder about that, which is why I put "probably" in my sentence

I did a bit more digging, and it turns out that the "fromIntegral" function is your man, as it converts from one integral type to another (presumably it's integral as in integer, not as in integration):

import Data.Char

char :: Integral a => a -> Char
char = chr . fromIntegral
There: a much more universal char function.
Arevos is offline   Reply With Quote