我想知道为什么我会收到这个错误。这是一个分配,我要将整数从整数转换为十六进制值。当我将整数值修改为 时,我调用此辅助转换函数16
。16
(与我在递归调用中除以的整数值连接)
这是我的代码:
changeToHex :: Integer -> String
--main function
toHex :: Integer -> String
toHex x
|x == 0 = '0'
|x == 1 = '1'
|x == 2 = '2'
|x == 3 = '3'
|x == 4 = '4'
|x == 5 = '5'
|x == 6 = '6'
|x == 7 = '7'
|x == 8 = '8'
|x == 9 = '9'
|x == 10 = 'A'
|x == 11 = 'B'
|x == 12 = 'C'
|x == 13 = 'D'
|x == 14 = 'E'
|x == 15 = 'F'