numhask-0.0.9: A numeric prelude

Safe HaskellNone
LanguageHaskell2010

NumHask.Algebra.Integral

Contents

Description

Integral domains

Synopsis

Integral

class Ring a => Integral a where Source #

Integral

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

Minimal complete definition

divMod

Methods

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

truncates towards negative infinity

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

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

class ToInteger a where Source #

toInteger and fromInteger as per the base Num instance is problematic for numbers with a Basis

Minimal complete definition

toInteger

Methods

toInteger :: a -> Integer Source #

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

This splitting away of fromInteger from the Ring instance tends to increase constraint boier-plate