Extend the partfrac structure

The roots are given implicitely by a polynomials:

In [6]: apart_structured(f)
Out[6]:
(1,
 Poly(0, x, domain='ZZ'),
 [(Poly(x - 2, x, domain='ZZ'), Lambda(_a, 4), 1),
  (Poly(x**2 - 1, x, domain='ZZ'), Lambda(_a, -3*_a - 6), 2),
  (Poly(x + 1, x, domain='ZZ'), Lambda(_a, -4), 1)])

In [7]: assemble_partfrac_full(_, x)
Out[7]: -4/(x + 1) - 3/(x + 1)**2 - 9/(x - 1)**2 + 4/(x - 2)

In [8]: pprint(_)
    4        3          9         4
- ───── - ──────── - ──────── + ─────
  x + 1          2          2   x - 2
          (x + 1)    (x - 1)

Some roots are given explicitely by a list of algebraic numbers:

In [5]: pfds = (1,
 Poly(0, x, domain='ZZ'),
 [(Poly(x - 2, x, domain='ZZ'), Lambda(a, 4), 1),
  ([1, -1], Lambda(a, -3*a - 6), 2),
  ([-1], Lambda(a, -4), 1)])

In [6]: assemble_partfrac_full(pfds, x)
Out[6]: -4/(x + 1) - 3/(x + 1)**2 - 9/(x - 1)**2 + 4/(x - 2)

In [7]: pprint(_)
    4        3          9         4
- ───── - ──────── - ──────── + ─────
  x + 1          2          2   x - 2
          (x + 1)    (x - 1)