我正在编写这段代码,我需要取消函数,以便它允许元组值输入。这是我的代码:
printField :: Int -> String -> String
--the function to be uncurried
printRow :: [(Int, String)] -> String
printRow d = map (uncurry printField) d
但它给我带来了以下错误,我不明白为什么:
Couldn't match type '[Char]' with 'Char' Expected type: Int -> String -> Char Actual type: Int -> String -> String In the first argument of 'uncurry', namely 'printField' In the first argument of 'map', namely '<uncurry printField>' In the expression: map <uncurry printField> d
有谁知道这意味着什么以及如何解决它?
提前致谢!
最诚挚的问候, Skyfe。
答案 0 :(得分:2)