Check whether a string contains exactly one distinct vowel
exactlyOne pred l = case filter pred l of
  [] -&gt; False
  (x:xs) -&gt; all (==x) xs


or equivalently

exactlyOne pred = (== (1 :: Natural)) . genericLength . nub . filter pred


since nub is lazy and takes O(optimal) time for this problem: If its input list has exactly one distinct member, the list is traversed once; if it has at least two, the list is traversed up to the second member and then (== (1 :: Natural)) knows to shortcut to False.

(I also like the operator .: and keep using it everywhere:)

infixr 8 .:
(f .: g) x = f . g x
exactlyOne = (== (1 :: Natural)) . genericLength . nub .: filter