algebra-simple-0.1: An alternative mathematical interface to Num.
Safe HaskellNone
LanguageHaskell2010

Numeric.Convert.Internal

Description

Since: 0.1

Synopsis

Integers

class FromInteger a where Source #

Replaces base's fromInteger functionality for when we do not have a Num instance.

1_000 :: Num a => a

-- becomes

fromZ 1_000 :: FromInteger a => a

Note that fromInteger's deficiencies are inherited e.g. Natural is partial, bounded types have over/underflow issues.

Since: 0.1

Methods

fromZ :: Integer -> a Source #

Since: 0.1

Instances

Instances details
FromInteger Int16 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Int16 Source #

FromInteger Int32 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Int32 Source #

FromInteger Int64 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Int64 Source #

FromInteger Int8 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Int8 Source #

FromInteger Word16 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Word16 Source #

FromInteger Word32 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Word32 Source #

FromInteger Word64 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Word64 Source #

FromInteger Word8 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Word8 Source #

FromInteger Integer Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

FromInteger Natural Source #

WARNING: Partial

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

FromInteger Double Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Double Source #

FromInteger Float Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Float Source #

FromInteger Int Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Int Source #

FromInteger Word Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Word Source #

RealFloat a => FromInteger (Complex a) Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromZ :: Integer -> Complex a Source #

FromInteger (Ratio Integer) Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

FromInteger (Ratio Natural) Source #

WARNING: Partial

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

class ToRational a => ToInteger a where Source #

Integer embedding.

Since: 0.1

Methods

toZ :: a -> Integer Source #

Since: 0.1

Instances

Instances details
ToInteger Int16 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Int16 -> Integer Source #

ToInteger Int32 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Int32 -> Integer Source #

ToInteger Int64 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Int64 -> Integer Source #

ToInteger Int8 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Int8 -> Integer Source #

ToInteger Word16 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Word16 -> Integer Source #

ToInteger Word32 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Word32 -> Integer Source #

ToInteger Word64 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Word64 -> Integer Source #

ToInteger Word8 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Word8 -> Integer Source #

ToInteger Integer Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Integer -> Integer Source #

ToInteger Natural Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Natural -> Integer Source #

ToInteger Int Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Int -> Integer Source #

ToInteger Word Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toZ :: Word -> Integer Source #

Rationals

class FromInteger a => FromRational a where Source #

Replaces base's fromRational functionality for when we do not have a Fractional instance.

5.5 :: Fractional a => a

-- becomes

fromQ 5.5 :: FromRational a => a

Note that fromRational's deficiencies are inherited e.g. Natural is partial, bounded types have over/underflow issues.

Since: 0.1

Methods

fromQ :: Rational -> a Source #

Since: 0.1

Instances

Instances details
FromRational Double Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

FromRational Float Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromQ :: Rational -> Float Source #

RealFloat a => FromRational (Complex a) Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromQ :: Rational -> Complex a Source #

FromRational (Ratio Integer) Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

FromRational (Ratio Natural) Source #

WARNING: Partial

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

class ToReal a => ToRational a where Source #

Rational embedding.

Since: 0.1

Methods

toQ :: a -> Rational Source #

Since: 0.1

Instances

Instances details
ToRational Int16 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Int16 -> Rational Source #

ToRational Int32 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Int32 -> Rational Source #

ToRational Int64 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Int64 -> Rational Source #

ToRational Int8 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Int8 -> Rational Source #

ToRational Word16 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Word16 -> Rational Source #

ToRational Word32 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Word32 -> Rational Source #

ToRational Word64 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Word64 -> Rational Source #

ToRational Word8 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Word8 -> Rational Source #

ToRational Integer Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Integer -> Rational Source #

ToRational Natural Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Natural -> Rational Source #

ToRational Double Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Double -> Rational Source #

ToRational Float Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Float -> Rational Source #

ToRational Int Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Int -> Rational Source #

ToRational Word Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toQ :: Word -> Rational Source #

ToRational (Ratio Integer) Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

ToRational (Ratio Natural) Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Reals

class FromRational a => FromReal a where Source #

Conversion from Double.

Since: 0.1

Methods

fromR :: Double -> a Source #

Since: 0.1

Instances

Instances details
FromReal Double Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromR :: Double -> Double Source #

FromReal Float Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromR :: Double -> Float Source #

RealFloat a => FromReal (Complex a) Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

fromR :: Double -> Complex a Source #

FromReal (Ratio Integer) Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

FromReal (Ratio Natural) Source #

WARNING: Partial

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

class ToReal a where Source #

Conversion to Double.

Since: 0.1

Methods

toR :: a -> Double Source #

Since: 0.1

Instances

Instances details
ToReal Int16 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Int16 -> Double Source #

ToReal Int32 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Int32 -> Double Source #

ToReal Int64 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Int64 -> Double Source #

ToReal Int8 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Int8 -> Double Source #

ToReal Word16 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Word16 -> Double Source #

ToReal Word32 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Word32 -> Double Source #

ToReal Word64 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Word64 -> Double Source #

ToReal Word8 Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Word8 -> Double Source #

ToReal Integer Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Integer -> Double Source #

ToReal Natural Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Natural -> Double Source #

ToReal Double Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Double -> Double Source #

ToReal Float Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Float -> Double Source #

ToReal Int Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Int -> Double Source #

ToReal Word Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

Methods

toR :: Word -> Double Source #

ToReal (Ratio Integer) Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal

ToReal (Ratio Natural) Source #

Since: 0.1

Instance details

Defined in Numeric.Convert.Internal