Add slightly nicer Yaml asList method.

This handles applying a function to each item to convert it to
the desired type, removing a tiny bit of duplication.