Я хочу преобразовать список кортежей: [(2,2,2), (3,3,3), (4,4,4), (5,5,5)] в просто перечислите: [2,2,2,3,3,3,4,4,4,5,5,5]
Я пробую это
map (\(a,b,c,d)->a:b:c:d) listOfTuples
, но получаю сообщение об ошибке.
Prelude> map (\(a,b,c)->a:b:c) [(1,2,3), (5,6,7)]
<interactive>:1:37:
No instance for (Num [t])
arising from the literal `7' at <interactive>:1:37
Possible fix: add an instance declaration for (Num [t])
In the expression: 7
In the expression: (5, 6, 7)
In the second argument of `map', namely `[(1, 2, 3), (5, 6, 7)]'
Prelude>
Как это сделать с лямбдой? И почему мои вещи не работают?