
8 Dec
2009
8 Dec
'09
5:34 p.m.
Hi! While trying to implement "words", we ran into the question of how to build lists of lists. The trouble boils down to this: test = []:[] is no problem, just as Prelude> []:[]:[]:[] [[],[],[]] works fine. Now trying to put the two together _is_ a problem: testlist 1 = []:[] testlist n = []:(testlist n-1) No instance for (Num [[a]]) arising from a use of `testlist' at <interactive>:1:0-9 Possible fix: add an instance declaration for (Num [[a]]) In the expression: testlist 2 In the definition of `it': it = testlist 2 Can someone please explain, what is going on here? Regards, Torsten