I want to remove an item from a list, but it comes back.
main = do
let y = ["aa","bb","cc","dd","ee","ff"]
let n = length y
replicateM_ (n-1) (deleteWord y)
deleteWord y = do
putStrLn "Write a word: "
word <- getLine
let new_y = delete word y
print new_y
Output:
*Main> main
Write a word:
aa
["bb","cc","dd","ee","ff"]
Write a word:
bb
["aa","cc","dd","ee","ff"]
Write a word:
cc
["aa","bb","dd","ee","ff"]
I want that the "aa" and "bb" stay removed and not come back into the list.