我是一个相对较新的Haskell用户。对于我的代码中在调用tau时出现的每个变量,我从GHCi得到了一个错误Ambiguous type variable ‘a0’ arising from (变量名) prevents the constraint‘(Field a0)’ from being solved.。to specify what ‘a0’ should be.我对Haskell的内部工作原理的掌握很差,
以下代码给出了一个错误: my_test = do (print CIntF) 以下是错误消息: • Ambiguous type variable ‘a0’ arising from a use of ‘print’
prevents the constraint ‘(Show a0)’ from being solved.Probable fix: use a type annotation to specify what ‘a0’ should be.(print CIntF)
我有以下函数来返回给定数字的因子对factorPairs n =' arising from a use of `it'
prevents the constraint `(Floating a0)' from being solved.Probable fix: use a type annotation to specify what `a0
我有一个函数,它返回一个列表,其中包含从第一个项目开始的原始列表中的所有其他项目。我得到以下错误: Ambiguous type variable ‘a0’ arising from a use of ‘show’ prevents the constraint ‘(Show a0)Probable fix: use a type annotation to specify what ‘a0’ should be. everyOtherInit orig pos acc = dopos+1) acc
e
else -(x**i)/(fact i)*Main> cosSeries 2 2
No instance for (Integral a0) arising from a use of `cosSeries'Possible fix: add a type signaturecosSeries 2 2
In an equation for `it': it = co
具体而言,可以考虑一些甚至像False `mkQ` isJust这样简单的内容,或者通常是对高类型数据类型的构造函数的查询。如果没有显式类型签名,它们就会在No instance for Typeable a0中失败,这可能是起作用的单态限制。当然可以。Data a => Maybe a -> Bool)Coul