The field of fractions over a GCD domain. The reason that it is an GCD domain is that we only want to work over reduced quotients.

- newtype GCDDomain a => FieldOfFractions a = F (a, a)
- numerator :: GCDDomain a => FieldOfFractions a -> a
- denominator :: GCDDomain a => FieldOfFractions a -> a
- toFieldOfFractions :: GCDDomain a => a -> FieldOfFractions a
- fromFieldOfFractions :: (GCDDomain a, Eq a) => FieldOfFractions a -> a
- reduce :: (GCDDomain a, Eq a) => FieldOfFractions a -> FieldOfFractions a
- propReduce :: (GCDDomain a, Eq a) => FieldOfFractions a -> Property

# Documentation

newtype GCDDomain a => FieldOfFractions a Source

Field of fractions

F (a, a) |

Fractional Q | |

Num Q | |

ExplicitUnits Q | |

(GCDDomain a, Eq a) => Eq (FieldOfFractions a) | |

(GCDDomain a, Show a, Eq a) => Show (FieldOfFractions a) | |

(GCDDomain a, Eq a, Arbitrary a) => Arbitrary (FieldOfFractions a) | |

(GCDDomain a, Eq a) => Ring (FieldOfFractions a) | |

(GCDDomain a, Eq a) => CommutativeRing (FieldOfFractions a) | |

(GCDDomain a, Eq a) => IntegralDomain (FieldOfFractions a) | |

(GCDDomain a, Eq a) => Field (FieldOfFractions a) | |

(Show k, Field k, Num k, Show x) => Num (FieldOfRationalFunctions k x) |

numerator :: GCDDomain a => FieldOfFractions a -> aSource

denominator :: GCDDomain a => FieldOfFractions a -> aSource

toFieldOfFractions :: GCDDomain a => a -> FieldOfFractions aSource

Embed a value in the field of fractions.

fromFieldOfFractions :: (GCDDomain a, Eq a) => FieldOfFractions a -> aSource

Extract a value from the field of fractions. This is only possible if the divisor is one.

reduce :: (GCDDomain a, Eq a) => FieldOfFractions a -> FieldOfFractions aSource

Reduce an element.

propReduce :: (GCDDomain a, Eq a) => FieldOfFractions a -> PropertySource