re: Daily Challenge #3 - Vowel Counter VIEW POST

FULL DISCUSSION
 

ReasonML

Sketch: sketch.sh/s/jjxviGaqjQ2P0ZI0SFC2Sg/

let is_vowel = letter =>
  switch (Char.lowercase_ascii(letter)) {
  | 'a'
  | 'e'
  | 'i'
  | 'o'
  | 'u'
  | 'y' => true
  | _ => false
  };

let explode = s => List.init(String.length(s), String.get(s));

let get_vowel_count = text =>
  text |> explode |> List.filter(is_vowel) |> List.length;

get_vowel_count("hello my name is Earl!");
code of conduct - report abuse