For each lin xsadd filter (/= xs) lto the result list:
remove y xs = [filter (/= y) l | l <- xs]
or by deleting the filter nested in it. For each xsin xssand for each xin, xshold xonly if it differs from y:
remove y xss = [ [x| x <- xs, x /= y] | xs <- xss]
It’s good if you just practice, but your version with is mapbetter :)
source
share