Match guard will be identified by `with` instead of `and`.
range sample function.