Add a variant of `gen' using list comprehensions