【发布时间】:2011-02-28 00:49:52
【问题描述】:
为什么我不能在 Haskell 中构造大元组?为什么有元组大小限制?
Prelude> (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
<interactive>:1:0:
No instance for (Show
(t,
t1,
t2,
...
t23))
arising from a use of `print' at <interactive>:1:0-48
Possible fix:
add an instance declaration for
(Show
(t,
t1,
t2,
...
t23))
In a stmt of a 'do' expression: print it
【问题讨论】:
-
如果你为它定义一个 Show 实例,你的代码能工作吗?
-
当然可以。但是,当您可以抱怨 SO 时,为什么还要阅读错误消息呢?
-
GHC 的建议不是一个糟糕、糟糕的想法的罕见案例之一。