plankton-0.0.0.1: The core of a numeric prelude, taken from numhask

Safe HaskellSafe
LanguageHaskell2010

Plankton.Integral

Description

Integral classes

Synopsis

Documentation

class Ring a => Integral a where Source #

Integral laws

b == zero || b * (a `div` b) + (a `mod` b) == a

Minimal complete definition

divMod

Methods

div :: a -> a -> a infixl 7 Source #

mod :: a -> a -> a infixl 7 Source #

divMod :: a -> a -> (a, a) Source #

class ToInteger a where Source #

toInteger is kept separate from Integral to help with compatability issues.

Minimal complete definition

toInteger

Methods

toInteger :: a -> Integer Source #

class FromInteger a where Source #

fromInteger is the most problematic of the Num class operators. Particularly heinous, it is assumed that any number type can be constructed from an Integer, so that the broad classes of objects that are composed of multiple elements is avoided in haskell.

Minimal complete definition

fromInteger

Methods

fromInteger :: Integer -> a Source #

fromIntegral :: (ToInteger a, FromInteger b) => a -> b Source #

coercion of Integrals

fromIntegral a == a