Implementing general partial application