I'm writing a recursive function that takes a char as input, and removes the char from a string on output.
Eg: INPUT: abbacysa | OUTPUT: bbcys
I'm a beginner in Haskell so just trying to wrap my head around recursion still with practice.
I start out by creating the function with an empty list I then select the elements within the list and begin the condition guard. I looked into using drop but I think maybe there is a better way of doing this?
removeChar [] = []
removeChar (x:xs)
| x `elem` "a" = removeChar drop "a"
removeChar = filter (/= 'a')
– Mark Seemann