Lennart Augustsson wrote: > Also, don't use (ord c - ord '0'), it doesn't work with Unicode digits. > That's why there is a digitToInt function.
FWIW, in Haskell 98, isDigit and digitToInt are defined as isDigit c = c >= '0' && c <= '9' digitToInt :: Char -> Int digitToInt c | isDigit c = fromEnum c - fromEnum '0' | c >= 'a' && c <= 'f' = fromEnum c - fromEnum 'a' + 10 | c >= 'A' && c <= 'F' = fromEnum c - fromEnum 'A' + 10 | otherwise = error "Char.digitToInt: not a digit" making this a bit of a red herring. I can't comment on why Bulat doesn't like negative numbers. Bertram _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe