algebra-4.3.1: Constructive abstract algebra

Safe HaskellSafe
LanguageHaskell98

Numeric.Algebra.Factorable

Contents

Synopsis

Factorable Multiplicative Semigroups

class Multiplicative m => Factorable m where Source #

`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.

Minimal complete definition

factorWith

Methods

factorWith :: (m -> m -> r) -> m -> NonEmpty r Source #

Instances

Factorable Bool Source # 

Methods

factorWith :: (Bool -> Bool -> r) -> Bool -> NonEmpty r Source #

Factorable () Source # 

Methods

factorWith :: (() -> () -> r) -> () -> NonEmpty r Source #

Partitionable r => Factorable (Exp r) Source # 

Methods

factorWith :: (Exp r -> Exp r -> r) -> Exp r -> NonEmpty r Source #

(Factorable a, Factorable b) => Factorable (a, b) Source # 

Methods

factorWith :: ((a, b) -> (a, b) -> r) -> (a, b) -> NonEmpty r Source #

(Factorable a, Factorable b, Factorable c) => Factorable (a, b, c) Source # 

Methods

factorWith :: ((a, b, c) -> (a, b, c) -> r) -> (a, b, c) -> NonEmpty r Source #

(Factorable a, Factorable b, Factorable c, Factorable d) => Factorable (a, b, c, d) Source # 

Methods

factorWith :: ((a, b, c, d) -> (a, b, c, d) -> r) -> (a, b, c, d) -> NonEmpty r Source #

(Factorable a, Factorable b, Factorable c, Factorable d, Factorable e) => Factorable (a, b, c, d, e) Source # 

Methods

factorWith :: ((a, b, c, d, e) -> (a, b, c, d, e) -> r) -> (a, b, c, d, e) -> NonEmpty r Source #