let s str =
let has_leading_space = String.get str ~index:0 = Some ' ' in
let has_ending_space = String.(get str ~index:(length str - 1)) = Some ' ' in
(if has_leading_space then space else empty)
% words str
% (if has_ending_space then space else empty)