numerator : Rational -> Int
The numerator of a rational in lowest terms (its sign is the value's sign).
import Data.RationalField)numerator : Rational -> Int
The numerator of a rational in lowest terms (its sign is the value's sign).
denominator : Rational -> Int
The denominator of a rational in lowest terms (always > 0).
rational : Int -> Int -> Rational
Build p / q in lowest terms with a positive denominator. rational 2 4 and rational 1 2 are the same value; rational 1 (-2) is (-1) / 2. (A zero denominator is left degenerate — division by it is undefined, exactly as for the built-in numeric types.) The normaliser is the Prelude's (module Core.Rational, with the instances): one implementation, delegated to.