Canonicalize patterns in lambda expressions