haskell remove element from list code example
Example 1: delete a as haskell
removeItem _ [] = []
removeItem x (y:ys) | x == y = removeItem x ys
| otherwise = y : removeItem x ys
Example 2: remove first element list haskell
a = [1, 2, 3, 4]
b = tail a
-- b == [2, 3, 4]