I get an error when calling Bob.hey
function
def foldl(list, acc, fun) when is_list(list) and is_function(fun)
code: assert Bob.hey("Tom-ay-to, tom-aaaah-to.") == "Whatever."
stacktrace:
(elixir) lib/list.ex:188: List.foldl/3
bob.exs:11: Bob.hey/1
bob_test.exs:12: (test)```
The two functions related to the error are:
```def remove_misplaced_chars(str) do
str
|> List.foldl("", fn(ch, acc) -> if valid_char?(ch), do: acc <> ch, else: acc end)
end
def valid_char?(ch) do
ch_up = String.upcase ch
if List.first(to_charlist(ch_up)) in 65..90 or ch == ",", do: true, else: false
end
What is wrong?