I prefer this approach for implementing is_whitespace. Saves a few lines and is quite readable. If I'm lucky the compiler is sufficiently smart to optimize it into submission. is_whitespace(C) -> lists:member(C, "\s\t\r\n").