是否有 Show Int 类型的值?
Is there a value that has a type of Show Int?
根据 idris Show Int
是一种类型。
*main> :t Show Int
Show Int : Type
具有该类型的值的示例是什么?
*main> :t ?
? : Show Int
我可以用什么替换 ?
来获得该行为?
我在这里找到了问题的答案:In Idris, is "Eq a" a type, and can I supply a value for it?
这是 Show
类型类
的单个实例
Show String where
show cs = strCons '"' (showLitString (cast cs) "\"")
在 Prelude/Show.idr
中定义,其中还定义了类型类
根据 idris Show Int
是一种类型。
*main> :t Show Int
Show Int : Type
具有该类型的值的示例是什么?
*main> :t ?
? : Show Int
我可以用什么替换 ?
来获得该行为?
我在这里找到了问题的答案:In Idris, is "Eq a" a type, and can I supply a value for it?
这是 Show
类型类
Show String where
show cs = strCons '"' (showLitString (cast cs) "\"")
在 Prelude/Show.idr
中定义,其中还定义了类型类