I need help to make a function in haskell in which you have a list and a number and then return the list without the given number
Enter [1,2,3,4,4,4,5] 4 Show [1,2,3,5]
This way removeElement :: (Eq a) = > [a] - > a - > [a]
Greetings
I need help to make a function in haskell in which you have a list and a number and then return the list without the given number
Enter [1,2,3,4,4,4,5] 4 Show [1,2,3,5]
This way removeElement :: (Eq a) = > [a] - > a - > [a]
Greetings
The easiest way would be using a list by understanding:
quitaElemento :: (Eq a) => [a] -> a -> [a]
quitaElemento l n = [ x | x <- l , x /= n]