I'm trying to create a function which can count vowels in a given String. Here is what I'm trying to do. I'm trying to solve the problem only with pipe operator and composition(>>) operator.
let vowels = ["a";"e";"i";"o";"u"]
let isVowel = fun c-> vowels |> List.contains c
let inline vowelCount string1 =
string1
|> Seq.toList
|> List.filter isVowel
This is the problem I'm getting when i run the code in F# interactive:
"error FS0001: The type 'string' is not compatible with the type 'seq'"
Where am i doing wrong? What do i fail to understand? Thanks in advance.