我正在使用用haskell编写的研究工具,我正在尝试运行代码,但由于版本更改,大部分错误已经出现。但实际上我无法理解haskell中的类型不匹配,例如在此代码中:
mkProp :: String -> String -> Content i
mkProp n s = (CElem (Elem ( N "property") [(( N "name"),(AttValue [Left n]))] [CString False s]))
错误是:
Couldn't match expected type `Content i0'
with actual type `i1 -> Content i1'
In the return type of a call of `CString'
Probable cause: `CString' is applied to too few arguments
In the expression: CString False s
In the third argument of `Elem', namely `[CString False s]'
有人可以向我解释如何修复此类错误,因为我也遇到了同样的错误
不同的代码,但可能的原因是因为CElem
适用于太少的参数?我的意思是在代码中查看函数使用的类型或传递的参数是错误的吗?
我正在使用ghc7.6.3和HaXml包v.1.13.3。 任何帮助将不胜感激。