Safe Haskell | None |
---|

- class Multiplicative m => Factorable m where
- factorWith :: (m -> m -> r) -> m -> NonEmpty r

# Factorable Multiplicative Semigroups

class Multiplicative m => Factorable m whereSource

`factorWith f c` returns a non-empty list containing `f a b` for all `a, b` such that `a * b = c`.

Results of factorWith f 0 are undefined and may result in either an error or an infinite list.

factorWith :: (m -> m -> r) -> m -> NonEmpty rSource

Factorable Bool | |

Factorable () | |

(Multiplicative (Exp r), Partitionable r) => Factorable (Exp r) | |

(Multiplicative (a, b), Factorable a, Factorable b) => Factorable (a, b) | |

(Multiplicative (a, b, c), Factorable a, Factorable b, Factorable c) => Factorable (a, b, c) | |

(Multiplicative (a, b, c, d), Factorable a, Factorable b, Factorable c, Factorable d) => Factorable (a, b, c, d) | |

(Multiplicative (a, b, c, d, e), Factorable a, Factorable b, Factorable c, Factorable d, Factorable e) => Factorable (a, b, c, d, e) |