Apply working with arbitrary function types