関数型プログラミング言語Haskell Part6
■ このスレッドは過去ログ倉庫に格納されています
0485デフォルトの名無しさん
2007/01/10(水) 17:49:05すみません、
Prelude> map succ [1,2,3]
[2,3,4]
を実行するとちゃんと実行できるんですけど、
Prelude> map succ [[],[],[]]
<interactive>:1:4:
No instance for (Enum [a])
arising from use of `succ' at <interactive>:1:4-7
Probable fix: add an instance declaration for (Enum [a])
In the first argument of `map', namely `succ'
In the definition of `it': it = map succ [[], [], []]
を実行するとあまりうれしくない結果が出てきます。
どうしてですか?[]は何型なのでしょう・・・
■ このスレッドは過去ログ倉庫に格納されています