Use monadic style for semantic checks