fact package:numeric-prelude

fromFactoredFraction x y computes the partial fraction representation of y % product x, where the elements of x must be irreducible. The function transforms the factors into their standard form with respect to unit factors. There are more direct methods for special cases like polynomials over rational numbers where the denominators are linear factors.
QC.listOf genSmallPrime /\ fractionConv
fmap (take 3) (QC.listOf genIrreduciblePolynomial) /\ fractionConv
QC.listOf genSmallPrime /\ fractionConvAlt
fmap (take 3) (QC.listOf genIrreduciblePolynomial) /\ fractionConvAlt
C is not really necessary here and only due to invokation of toFraction.