How do you map a function to operate on lists within a list? The following is just what I'm trying to do as an example, but I was just asking as a general question. Thanks in advance!
Right now, I'm trying to map a function, change, onto each lists of one list (returned by itrCol xs).
evalChange xs = map change $ itrCol xs
where itrCol returns a list of lists, where each containing list is a column.
itrCol xs = [getCol x xs | x <- (take (width xs) (iterate (\x -> (x + 1)*1) 0))]
getCol lists column given list of column indices
getCol :: Int -> [t] -> [t]
and change is:
change [] = []
change [x] = [x]
change [x,y] = [x,y]
change (x:y:z:ws) | x == y && y == z = 0 : y*(-1) : 0 : change ws
change (x:xs) = x : change xs
widthwhen you might have meantlength?