I need to make a function that removes the first occurrence of an element, given in the second argument, from the list given as the first argument.
The print should for example look like this:
rem1 "abab" 'a' == "bab"
rem1 "abab" 'b' == "aab"
rem1 "abab" 'c' == "abab"
Completely new to Haskell and not sure where to begin. Any helpers? :)
Edit: This is what I have now, and it gives me "variable not in scope"
rem1 :: Eq a => [a] -> a -> [a]
rem1 [] _ = []
rem1 (x:xs) y
| x == y = xs
| otherwise = x : rem1 xs y