7 Sep
2006
7 Sep
'06
7:23 a.m.
Hello Peter, Thursday, September 7, 2006, 11:02:12 AM, you wrote:
[10] test :: [(Int, Double)] -> Int [11] test [(i,v):ps] = i
test ((i,v):ps) = i your mistake was using for grouping [] instead of () [] should be used only with ',' or '..': [1,2,3] [(1,0.7), (2,0.8)] [1..10] (x:xs) means constructing list from element representing head of new list and old list representing all remaining elements [x:xs] is equivalent to [(x:xs)] and means constructing singleton (one-element) list which only element is another list, namely (x:xs). so, you got list of lists ps: btw, it's better to ask newbie questions in haskell-cafe list -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com