
13 Aug
2012
13 Aug
'12
5:58 a.m.
On Mon, 13 Aug 2012 07:37:48 +0200, Shakthi Kannan
Hi,
--- On Mon, Aug 13, 2012 at 10:51 AM, Christopher Howard
wrote: | Say, for example, I have the list | [[1,2],[3,4]] and want to add 1 to each inner element, resulting in | [[2,3],[4,5]]. \-- Like this?
ghci> let xxs = [[1,2], [3,4]]
ghci> [ [ x+1 | x <- xs] | xs <- xxs ] [[2,3],[4,5]]
Or this?
map (map (+ 1)) [[1,2], [3,4]] [[2,3],[4,5]]
Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --