example of collect and partial function