HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulenumeric-prelude-0.4.4Haskell98

Algebra.ToInteger

  • 1 class
  • 3 values
classclass (C a, C a) => C a where
#

The two classes C and C exist to allow convenient conversions, primarily between the built-in types. They should satisfy

  fromInteger .  toInteger === id
   toRational .  toInteger === toRational

Conversions must be lossless, that is, they do not round in any way. For rounding see Algebra.RealRing.

I think that the RealIntegral superclass is too restrictive. Non-negative numbers are not a ring, but can be easily converted to Integers.

Methods

Instances16C, …
  • C IntegerDefined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C Int16Defined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C Int32Defined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C Int64Defined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C Int8Defined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C Word16Defined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C Word32Defined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C Word64Defined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C Word8Defined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C IntDefined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C WordDefined in numeric-prelude-0.4.4 · Algebra.ToInteger
  • C TDefined in numeric-prelude-0.4.4 · Number.Peano
  • Integral a => C (T a)Defined in numeric-prelude-0.4.4 · MathObj.Wrapper.Haskell98
  • C a => C (T a)Defined in numeric-prelude-0.4.4 · Number.NonNegative · orphan
  • C a => C (T a)Defined in numeric-prelude-0.4.4 · MathObj.Wrapper.NumericPrelude
  • (C a, C a) => C (T a)Defined in numeric-prelude-0.4.4 · Number.NonNegativeChunky
valuefieldPower :: (C a, C b) => b -> a -> a
#

A prefix function of (Algebra.Field.^-). It has a generalised exponent.

Orphan instances

1 instance
  • (C a, C a) => C (T a)