Delete an item from a Haskell list

0

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

    
asked by Leónardo Sánchez Espinoza 05.10.2018 в 04:04
source

1 answer

0

The easiest way would be using a list by understanding:

quitaElemento :: (Eq a) => [a] -> a -> [a]
quitaElemento l n = [ x | x <- l , x /= n]
    
answered by 03.01.2019 в 13:45