delete a as haskell
removeItem _ [] = [] removeItem x (y:ys) | x == y = removeItem x ys | otherwise = y : removeItem x ys
Source: stackoverflow.com
removeItem _ [] = [] removeItem x (y:ys) | x == y = removeItem x ys | otherwise = y : removeItem x ys