match to partial function