class Visible a where size :: a -> Int
| otherwise = (intToString (div n 10)) ++ (intToString (mod n 10))instance Visible Intwhere size n = length (toString n)
如果我键入类似
输出中打印“整数是int”。is not int")我想使用is操作符,就像我可以使用isKindOfClass方法一样--类(或者更确切地说是类型)存储在变量中。与源代码中的其他地方相比,IntType在if条件下甚至有不同的颜色(如果您将它粘贴到操场上),这意味着(正如错误消息所述)它被视为类名(就像IntType将是类)。好的,我会进一步解释我想实现什么。我有对象,它管理泛型<