Idris2Doc : Data.Ratio

Data.Ratio

(source)

Definitions

recordRatio : Type->Type
  Ratio types, represented by a numerator and denominator of type `a`.

Most numeric operations require an instance `Integral a` in order to
simplify the returned ratio and reduce storage space.

Totality: total
Visibility: export
Constructor: 
MkRatio : a->a->Ratioa

Projections:
.denom : Ratioa->a
  Return the denominator of the ratio in reduced form.
This value is guaranteed to always be positive.
.dn : Ratioa->a
.nm : Ratioa->a
.numer : Ratioa->a
  Return the numerator of the ratio in reduced form.

Hints:
(IntegralGCDa, Absa) =>Abs (Ratioa)
Numa=>Casta (Ratioa)
Castab=>Cast (Ratioa) (Ratiob)
(Castab, Fractionalb) =>Cast (Ratioa) b
Eqa=>Eq (Ratioa)
IntegralGCDa=>Fractional (Ratioa)
(IntegralGCDa, Nega) =>Neg (Ratioa)
IntegralGCDa=>Num (Ratioa)
(Orda, Numa) =>Ord (Ratioa)
Showa=>Show (Ratioa)
Rational : Type
  Rational numbers, represented as a ratio between
two arbitrary-precision integers.

Rationals can be constructed using `//`.

Totality: total
Visibility: public export
numer : Ratioa->a
  Return the numerator of the ratio in reduced form.

Totality: total
Visibility: export
.numer : Ratioa->a
  Return the numerator of the ratio in reduced form.

Totality: total
Visibility: export
denom : Ratioa->a
  Return the denominator of the ratio in reduced form.
This value is guaranteed to always be positive.

Totality: total
Visibility: export
.denom : Ratioa->a
  Return the denominator of the ratio in reduced form.
This value is guaranteed to always be positive.

Totality: total
Visibility: export
reduce : IntegralGCDa=>Ratioa->Ratioa
  Reduce a ratio by dividing both components by their common factor. Most
operations automatically reduce the returned ratio, so explicitly calling
this function is usually unnecessary.

Totality: total
Visibility: export
mkRatioMaybe : IntegralGCDa=>a->a->Maybe (Ratioa)
  Construct a ratio of two values, returning `Nothing` if the denominator is
zero.

Totality: total
Visibility: export
mkRatio : IntegralGCDa=>a->a->Ratioa
  Create a ratio of two values.

Visibility: export
unsafeMkRatio : a->a->Ratioa
  Create a ratio of two values, unsafely assuming that they are coprime and
the denominator is non-zero.
WARNING: This function will behave erratically and may crash your program
if these conditions are not met!

Totality: total
Visibility: export
(//) : {auto{conArg:1935} : IntegralGCDa} ->a-> (d : a) -> {auto0_ : So (d/=0)} ->Ratioa
  Construct a ratio of two values.

Totality: total
Visibility: export
Fixity Declaration: infix operator, level 9
floor : Integrala=>Ratioa->a
  Round a ratio down to the nearest integer less than it.

Totality: total
Visibility: export