【发布时间】:2011-02-19 17:27:24
【问题描述】:
我正在用 Haskell 玩一点,我遇到了这个错误,使用带有元组(字符串,列表)的 snd 函数。
snd ("Felix Felices",[("Escarabajos Machacados",52,[f1,f2]),("Ojo de Tigre Sucio",2,[f2])])
ERROR - Cannot find "show" function for:
*** Expression : snd ("Felix Felices",[("Escarabajos Machacados",52,[f1,f2]),("Ojo de Tigre Sucio",2,[f2])])
*** Of type : [([Char],Integer,[(Integer,Integer,Integer) -> (Integer,Integer,Integer)])]
问题是,如果我删除 f1、f2 和 f3(它们是函数),代码就可以正常工作,它会返回列表。为什么会这样,为什么我不能在元组的第二个位置放一个函数?
【问题讨论】:
标签: haskell functional-programming