I want to remove every occurance of a certain value from a list. I have written a function to do this:
removeall val [] = []
removeall val list = if (head list) == val
then removeall val (tail list)
else (head list):(removeall val (tail list))
but I would like to use Prelude if possible for reasons of elegance and readability.