How to match the pattern of a function in Relay?

I’d like to be able to rewrite a composite function into a single op. Obviously can be done with an ExprMutator but it’d be more convenient if the pattern language could do it.