ideas-math-types-1.1: Common types for mathematical domain reasoners

Maintainer bastiaan.heeren@ou.nl provisional portable (depends on ghc) Safe Haskell2010

Domain.Math.Safe

Contents

Description

Synopsis

# Safe division

class Num a => SafeDiv a where Source #

Minimal complete definition

safeDiv

Methods

safeDiv :: a -> a -> Maybe a Source #

safeRecip :: a -> Maybe a Source #

Instances
 Source # Instance detailsDefined in Domain.Math.Safe Methods Source # Instance detailsDefined in Domain.Math.Safe Methods Source # Instance detailsDefined in Domain.Math.Data.DecimalFraction Methods Integral a => SafeDiv (Ratio a) Source # Instance detailsDefined in Domain.Math.Safe MethodssafeDiv :: Ratio a -> Ratio a -> Maybe (Ratio a) Source #safeRecip :: Ratio a -> Maybe (Ratio a) Source # (Eq a, Fractional a) => SafeDiv (SquareRoot a) Source # Instance detailsDefined in Domain.Math.Data.SquareRoot MethodssafeDiv :: SquareRoot a -> SquareRoot a -> Maybe (SquareRoot a) Source # (Eq a, Fractional a) => SafeDiv (Polynomial a) Source # Instance detailsDefined in Domain.Math.Data.Polynomial MethodssafeDiv :: Polynomial a -> Polynomial a -> Maybe (Polynomial a) Source #

safeDivFractional :: (Eq a, Fractional a) => a -> a -> Maybe a Source #

# Safe power and root

class Num a => SafePower a where Source #

Minimal complete definition

Methods

safePower :: a -> a -> Maybe a Source #

safeSqrt :: a -> Maybe a Source #

safeRoot :: a -> a -> Maybe a Source #

Instances
 Source # Instance detailsDefined in Domain.Math.Safe Methods Source # Instance detailsDefined in Domain.Math.Safe Methods Source # Instance detailsDefined in Domain.Math.Data.DecimalFraction Methods Integral a => SafePower (Ratio a) Source # Instance detailsDefined in Domain.Math.Safe MethodssafePower :: Ratio a -> Ratio a -> Maybe (Ratio a) Source #safeSqrt :: Ratio a -> Maybe (Ratio a) Source #safeRoot :: Ratio a -> Ratio a -> Maybe (Ratio a) Source #