-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Fractions -- -- This package provides a data type whose values represent fractions. -- -- A fraction can be seen as a real number from the closed interval -- [0,1]. It can also be seen as a percentage. @package fraction @version 0.0.0.0 -- | This module is about fractions. -- -- A fraction can be seen as a real number from the closed interval -- [0,1]. It can also be seen as a percentage. A typical example of a -- fraction is the extend of a progress bar. module Data.Fraction -- | A fraction. data Fraction -- | Converts a factor into its corresponding fraction. -- -- If the factor is not from the interval [0,1], a runtime error occurs. fromFactor :: Double -> Fraction -- | Converts a percentage into its corresponding fraction. -- -- If the percentage is not from the interval [0,100], a runtime error -- occurs. fromPercentage :: Double -> Fraction -- | Converts a fraction into its corresponding factor. toFactor :: Fraction -> Double -- | Converts a fraction into its corresponding percentage. toPercentage :: Fraction -> Double instance Monoid Fraction instance Semigroup Fraction