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

Numeric.Convert.Integer

Description

Provides the FromInteger and ToInteger typeclasses.

Since: 0.1

Synopsis

Documentation

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

fromℤ :: (FromInteger a, HasCallStack) => Integer -> a Source #

Unicode alias for fromZ, with U+2114.

Since: 0.1

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 #

toℤ :: (HasCallStack, ToInteger a) => a -> Integer Source #

Unicode alias for toZ, with U+2114.

Since: 0.1