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)
- toFieldOfFractions :: GCDDomain a => a -> FieldOfFractions a
- fromFieldOfFractions :: (GCDDomain a, Eq a) => FieldOfFractions a -> a
- reduce :: (GCDDomain a, Eq a) => FieldOfFractions a -> FieldOfFractions a

# Documentation

newtype GCDDomain a => FieldOfFractions a Source

Field of fractions

F (a, a) |

(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) |

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.