numeric-prelude-0.0.2: An experimental alternative hierarchy of numeric type classesContentsIndex
Algebra.ToRational
Synopsis
class C a => C a where
toRational :: a -> Rational
Documentation
class C a => C a where

This class allows lossless conversion from any representation of a rational to the fixed Rational type. "Lossless" means - don't do any rounding. For rounding see Algebra.RealField. With the instances for Float and Double we acknowledge that these types actually represent rationals rather than (approximated) real numbers. However, this contradicts to the Transcendental

Laws that must be satisfied by instances:

  fromRational' . toRational === id
Methods
toRational :: a -> Rational
Lossless conversion from any representation of a rational to Rational
show/hide Instances
C Double
C Float
C Int
C Integer
C T
(C a, C a) => C (T a)
C a => C (T a)
Produced by Haddock version 0.7