planet-mitchell-0.1.0: Planet Mitchell

Num.Fractional

Synopsis

# Documentation

class Num a => Fractional a where #

Fractional numbers, supporting real division.

Minimal complete definition

fromRational, (recip | (/))

Methods

(/) :: a -> a -> a infixl 7 #

fractional division

recip :: a -> a #

reciprocal fraction

fromRational :: Rational -> a #

Conversion from a Rational (that is Ratio Integer). A floating literal stands for an application of fromRational to a value of type Rational, so such literals have type (Fractional a) => a.

Instances
 WARNING: recip and / will throw an error when their outputs are repeating decimals.fromRational will throw an error when the input Rational is a repeating decimal. Consider using fromRationalRepetend for these rationals which will detect the repetition and indicate where it starts. Instance detailsDefined in Data.Scientific Methods Instance detailsDefined in Foreign.C.Types Methods(/) :: CFloat -> CFloat -> CFloat # Instance detailsDefined in Foreign.C.Types Methods Instance detailsDefined in Data.ExactPi Methods Instance detailsDefined in Numeric.Half Methods(/) :: Half -> Half -> Half #recip :: Half -> Half # Instance detailsDefined in Data.Time.Clock.Internal.NominalDiffTime Methods Instance detailsDefined in Data.Time.Clock.Internal.DiffTime Methods Instance detailsDefined in Data.Constraint Methods Instance detailsDefined in Data.Constraint Methods Integral a => Fractional (Ratio a) Since: base-2.0.1 Instance detailsDefined in GHC.Real Methods(/) :: Ratio a -> Ratio a -> Ratio a #recip :: Ratio a -> Ratio a # RealFloat a => Fractional (Complex a) Since: base-2.1 Instance detailsDefined in Data.Complex Methods(/) :: Complex a -> Complex a -> Complex a #recip :: Complex a -> Complex a # HasResolution a => Fractional (Fixed a) Since: base-2.1 Instance detailsDefined in Data.Fixed Methods(/) :: Fixed a -> Fixed a -> Fixed a #recip :: Fixed a -> Fixed a # Fractional a => Fractional (Identity a) Instance detailsDefined in Data.Functor.Identity Methods(/) :: Identity a -> Identity a -> Identity a #recip :: Identity a -> Identity a # (Precise a, RealFloat a) => Fractional (Log a) Instance detailsDefined in Numeric.Log Methods(/) :: Log a -> Log a -> Log a #recip :: Log a -> Log a # Fractional a => Fractional (Managed a) Instance detailsDefined in Control.Monad.Managed Methods(/) :: Managed a -> Managed a -> Managed a #recip :: Managed a -> Managed a # Class (Fractional a) (Floating a) Instance detailsDefined in Data.Constraint Methods Class (Num a) (Fractional a) Instance detailsDefined in Data.Constraint Methods (Fractional a) :=> (Fractional (Identity a)) Instance detailsDefined in Data.Constraint Methods (Fractional a) :=> (Fractional (Const a b)) Instance detailsDefined in Data.Constraint Methodsins :: Fractional a :- Fractional (Const a b) # (Integral a) :=> (Fractional (Ratio a)) Instance detailsDefined in Data.Constraint Methods (RealFloat a) :=> (Fractional (Complex a)) Instance detailsDefined in Data.Constraint Methods Fractional a => Fractional (Op a b) Instance detailsDefined in Data.Functor.Contravariant Methods(/) :: Op a b -> Op a b -> Op a b #recip :: Op a b -> Op a b #fromRational :: Rational -> Op a b # Fractional b => Fractional (Fold a b) Instance detailsDefined in Control.Foldl Methods(/) :: Fold a b -> Fold a b -> Fold a b #recip :: Fold a b -> Fold a b #fromRational :: Rational -> Fold a b # (Monad m, Fractional a) => Fractional (ListT m a) Instance detailsDefined in List.Transformer Methods(/) :: ListT m a -> ListT m a -> ListT m a #recip :: ListT m a -> ListT m a #fromRational :: Rational -> ListT m a # Class (Real a, Fractional a) (RealFrac a) Instance detailsDefined in Data.Constraint Methodscls :: RealFrac a :- (Real a, Fractional a) # Fractional a => Fractional (Const a b) Instance detailsDefined in Data.Functor.Const Methods(/) :: Const a b -> Const a b -> Const a b #recip :: Const a b -> Const a b #fromRational :: Rational -> Const a b # (Monad m, Fractional b) => Fractional (FoldM m a b) Instance detailsDefined in Control.Foldl Methods(/) :: FoldM m a b -> FoldM m a b -> FoldM m a b #recip :: FoldM m a b -> FoldM m a b #fromRational :: Rational -> FoldM m a b # Fractional a => Fractional (Tagged s a) Instance detailsDefined in Data.Tagged Methods(/) :: Tagged s a -> Tagged s a -> Tagged s a #recip :: Tagged s a -> Tagged s a #fromRational :: Rational -> Tagged s a #

(^^) :: (Fractional a, Integral b) => a -> b -> a infixr 8 #

raise a number to an integral power