aop-prelude-0.4.0.0: prelude for Algebra of Programming

AOPPrelude

Synopsis

# Documentation

(.) :: (b -> c) -> (a -> b) -> a -> c infixr 9 Source #

const :: a -> b -> a Source #

id :: a -> a Source #

outl :: (a, b) -> a Source #

outr :: (a, b) -> b Source #

swap :: (a, b) -> (b, a) Source #

assocl :: (a, (b, c)) -> ((a, b), c) Source #

assocr :: ((a, b), c) -> (a, (b, c)) Source #

dupl :: (a, (b, c)) -> ((a, b), (a, c)) Source #

dupr :: ((a, b), c) -> ((a, c), (b, c)) Source #

pair :: (a -> b, a -> c) -> a -> (b, c) Source #

cross :: (a -> c, b -> d) -> (a, b) -> (c, d) Source #

cond :: (a -> Bool) -> (a -> b, a -> b) -> a -> b Source #

curry :: ((a, b) -> c) -> a -> b -> c Source #

uncurry :: (a -> b -> c) -> (a, b) -> c Source #

false :: a -> Bool Source #

true :: a -> Bool Source #

(&&) :: Bool -> Bool -> Bool infixr 3 Source #

(||) :: Bool -> Bool -> Bool infixr 2 Source #

leq :: Ord a => (a, a) -> Bool Source #

less :: Ord a => (a, a) -> Bool Source #

eql :: Ord a => (a, a) -> Bool Source #

neq :: Ord a => (a, a) -> Bool Source #

gtr :: Ord a => (a, a) -> Bool Source #

geq :: Ord a => (a, a) -> Bool Source #

meet :: (a -> Bool, a -> Bool) -> a -> Bool Source #

join :: (a -> Bool, a -> Bool) -> a -> Bool Source #

wok :: ((b, a) -> c) -> (a, b) -> c Source #

zero :: Num a => t -> a Source #

succ :: Num a => a -> a Source #

pred :: Num a => a -> a Source #

plus :: Num a => (a, a) -> a Source #

minus :: Num a => (a, a) -> a Source #

times :: Num a => (a, a) -> a Source #

divide :: Fractional a => (a, a) -> a Source #

negative :: (Ord a, Num a) => a -> Bool Source #

positive :: (Ord a, Num a) => a -> Bool Source #

(++) :: [a] -> [a] -> [a] infixr 5 Source #

null :: [a] -> Bool Source #

nil :: t -> [a] Source #

wrap :: a -> [a] Source #

cons :: (a, [a]) -> [a] Source #

cat :: ([a], [a]) -> [a] Source #

concat :: [[a]] -> [a] Source #

snoc :: ([a], a) -> [a] Source #

head :: [a] -> a Source #

tail :: [a] -> [a] Source #

split :: [a] -> (a, [a]) Source #

last :: [a] -> a Source #

init :: [a] -> [a] Source #

inits :: [a] -> [[a]] Source #

tails :: [a] -> [[a]] Source #

splits :: [a] -> [([a], [a])] Source #

cpp :: ([a], [b]) -> [(a, b)] Source #

cpl :: ([a], b) -> [(a, b)] Source #

cpr :: (a, [b]) -> [(a, b)] Source #

cplist :: [[a]] -> [[a]] Source #

minlist :: ((a, a) -> Bool) -> [a] -> a Source #

bmin :: ((a, a) -> Bool) -> (a, a) -> a Source #

maxlist :: ((a, a) -> Bool) -> [a] -> a Source #

bmax :: ((a, a) -> Bool) -> (a, a) -> a Source #

thinlist :: ((a, a) -> Bool) -> [a] -> [a] Source #

length :: Num a => [t] -> a Source #

sum :: Num a => [a] -> a Source #

trans :: [[a]] -> [[a]] Source #

list :: (a -> b) -> [a] -> [b] Source #

filter :: (a -> Bool) -> [a] -> [a] Source #

catalist :: (b, (a, b) -> b) -> [a] -> b Source #

cata1list :: (a -> b, (a, b) -> b) -> [a] -> b Source #

cata2list :: ((a, a) -> b, (a, b) -> b) -> [a] -> b Source #

loop :: ((a, b) -> a) -> (a, [b]) -> a Source #

merge :: ((a, a) -> Bool) -> ([a], [a]) -> [a] Source #

zip :: ([a], [b]) -> [(a, b)] Source #

unzip :: [(a, b)] -> ([a], [b]) Source #

ord :: Char -> Int #

The fromEnum method restricted to the type Char.

chr :: Int -> Char #

The toEnum method restricted to the type Char.

(==) :: Eq a => a -> a -> Bool infix 4 #

(/=) :: Eq a => a -> a -> Bool infix 4 #

(<=) :: Ord a => a -> a -> Bool infix 4 #

(<) :: Ord a => a -> a -> Bool infix 4 #

(>=) :: Ord a => a -> a -> Bool infix 4 #

(>) :: Ord a => a -> a -> Bool infix 4 #

(+) :: Num a => a -> a -> a infixl 6 #

(-) :: Num a => a -> a -> a infixl 6 #

(/) :: Fractional a => a -> a -> a infixl 7 #

fractional division

div :: Integral a => a -> a -> a infixl 7 #

integer division truncated toward negative infinity

mod :: Integral a => a -> a -> a infixl 7 #

integer modulus, satisfying

(x div y)*y + (x mod y) == x

(*) :: Num a => a -> a -> a infixl 7 #

negate :: Num a => a -> a #

Unary negation.

primPrint :: Show a => a -> IO () Source #

strict :: (a -> b) -> a -> b Source #

error :: HasCallStack => [Char] -> a #

error stops execution and displays an error message.

show :: Show a => a -> String #

A specialised variant of showsPrec, using precedence context zero, and returning an ordinary String.

flip :: (a -> b -> c) -> b -> a -> c Source #

type String = [Char] #

A String is a list of characters. String constants in Haskell are values of type String.

class Eq a #

The Eq class defines equality (==) and inequality (/=). All the basic datatypes exported by the Prelude are instances of Eq, and Eq may be derived for any datatype whose constituents are also instances of Eq.

The Haskell Report defines no laws for Eq. However, == is customarily expected to implement an equivalence relationship where two values comparing equal are indistinguishable by "public" functions, with a "public" function being one not allowing to see implementation details. For example, for a type representing non-normalised natural numbers modulo 100, a "public" function doesn't make the difference between 1 and 201. It is expected to have the following properties:

Reflexivity
x == x = True
Symmetry
x == y = y == x
Transitivity
if x == y && y == z = True, then x == z = True
Substitutivity
if x == y = True and f is a "public" function whose return type is an instance of Eq, then f x == f y = True
Negation
x /= y = not (x == y)

Minimal complete definition: either == or /=.

Minimal complete definition

Instances
 Instance detailsDefined in GHC.Classes Methods(==) :: Bool -> Bool -> Bool #(/=) :: Bool -> Bool -> Bool # Instance detailsDefined in GHC.Classes Methods(==) :: Char -> Char -> Bool #(/=) :: Char -> Char -> Bool # Note that due to the presence of NaN, Double's Eq instance does not satisfy reflexivity.>>> 0/0 == (0/0 :: Double) False Also note that Double's Eq instance does not satisfy substitutivity:>>> 0 == (-0 :: Double) True >>> recip 0 == recip (-0 :: Double) False  Instance detailsDefined in GHC.Classes Methods(==) :: Double -> Double -> Bool #(/=) :: Double -> Double -> Bool # Note that due to the presence of NaN, Float's Eq instance does not satisfy reflexivity.>>> 0/0 == (0/0 :: Float) False Also note that Float's Eq instance does not satisfy substitutivity:>>> 0 == (-0 :: Float) True >>> recip 0 == recip (-0 :: Float) False  Instance detailsDefined in GHC.Classes Methods(==) :: Float -> Float -> Bool #(/=) :: Float -> Float -> Bool # Instance detailsDefined in GHC.Classes Methods(==) :: Int -> Int -> Bool #(/=) :: Int -> Int -> Bool # Instance detailsDefined in GHC.Integer.Type Methods(==) :: Integer -> Integer -> Bool #(/=) :: Integer -> Integer -> Bool # Since: base-4.8.0.0 Instance detailsDefined in GHC.Natural Methods(==) :: Natural -> Natural -> Bool #(/=) :: Natural -> Natural -> Bool # Instance detailsDefined in GHC.Classes Methods Instance detailsDefined in GHC.Classes Methods(==) :: Word -> Word -> Bool #(/=) :: Word -> Word -> Bool # Eq () Instance detailsDefined in GHC.Classes Methods(==) :: () -> () -> Bool #(/=) :: () -> () -> Bool # Instance detailsDefined in GHC.Classes Methods(==) :: TyCon -> TyCon -> Bool #(/=) :: TyCon -> TyCon -> Bool # Instance detailsDefined in GHC.Classes Methods(==) :: Module -> Module -> Bool #(/=) :: Module -> Module -> Bool # Instance detailsDefined in GHC.Classes Methods(==) :: TrName -> TrName -> Bool #(/=) :: TrName -> TrName -> Bool # Instance detailsDefined in GHC.Integer.Type Methods(==) :: BigNat -> BigNat -> Bool #(/=) :: BigNat -> BigNat -> Bool # Since: base-4.9.0.0 Instance detailsDefined in GHC.Stack.Types Methods(==) :: SrcLoc -> SrcLoc -> Bool #(/=) :: SrcLoc -> SrcLoc -> Bool # Eq a => Eq [a] Instance detailsDefined in GHC.Classes Methods(==) :: [a] -> [a] -> Bool #(/=) :: [a] -> [a] -> Bool # Eq a => Eq (Maybe a) Since: base-2.1 Instance detailsDefined in GHC.Maybe Methods(==) :: Maybe a -> Maybe a -> Bool #(/=) :: Maybe a -> Maybe a -> Bool # Eq a => Eq (Ratio a) Since: base-2.1 Instance detailsDefined in GHC.Real Methods(==) :: Ratio a -> Ratio a -> Bool #(/=) :: Ratio a -> Ratio a -> Bool # Eq a => Eq (NonEmpty a) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(==) :: NonEmpty a -> NonEmpty a -> Bool #(/=) :: NonEmpty a -> NonEmpty a -> Bool # (Eq a, Eq b) => Eq (a, b) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b) -> (a, b) -> Bool #(/=) :: (a, b) -> (a, b) -> Bool # (Eq a, Eq b, Eq c) => Eq (a, b, c) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c) -> (a, b, c) -> Bool #(/=) :: (a, b, c) -> (a, b, c) -> Bool # (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d) -> (a, b, c, d) -> Bool #(/=) :: (a, b, c, d) -> (a, b, c, d) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #(/=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #(/=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #(/=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #(/=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

class Eq a => Ord a #

The Ord class is used for totally ordered datatypes.

Instances of Ord can be derived for any user-defined datatype whose constituent types are in Ord. The declared order of the constructors in the data declaration determines the ordering in derived Ord instances. The Ordering datatype allows a single comparison to determine the precise ordering of two objects.

The Haskell Report defines no laws for Ord. However, <= is customarily expected to implement a non-strict partial order and have the following properties:

Transitivity
if x <= y && y <= z = True, then x <= z = True
Reflexivity
x <= x = True
Antisymmetry
if x <= y && y <= x = True, then x == y = True

Note that the following operator interactions are expected to hold:

1. x >= y = y <= x
2. x < y = x <= y && x /= y
3. x > y = y < x
4. x < y = compare x y == LT
5. x > y = compare x y == GT
6. x == y = compare x y == EQ
7. min x y == if x <= y then x else y = True
8. max x y == if x >= y then x else y = True

Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types.

Minimal complete definition

Instances
 Instance detailsDefined in GHC.Classes Methodscompare :: Bool -> Bool -> Ordering #(<) :: Bool -> Bool -> Bool #(<=) :: Bool -> Bool -> Bool #(>) :: Bool -> Bool -> Bool #(>=) :: Bool -> Bool -> Bool #max :: Bool -> Bool -> Bool #min :: Bool -> Bool -> Bool # Instance detailsDefined in GHC.Classes Methodscompare :: Char -> Char -> Ordering #(<) :: Char -> Char -> Bool #(<=) :: Char -> Char -> Bool #(>) :: Char -> Char -> Bool #(>=) :: Char -> Char -> Bool #max :: Char -> Char -> Char #min :: Char -> Char -> Char # Note that due to the presence of NaN, Double's Ord instance does not satisfy reflexivity.>>> 0/0 <= (0/0 :: Double) False Also note that, due to the same, Ord's operator interactions are not respected by Double's instance:>>> (0/0 :: Double) > 1 False >>> compare (0/0 :: Double) 1 GT  Instance detailsDefined in GHC.Classes Methods(<) :: Double -> Double -> Bool #(<=) :: Double -> Double -> Bool #(>) :: Double -> Double -> Bool #(>=) :: Double -> Double -> Bool #max :: Double -> Double -> Double #min :: Double -> Double -> Double # Note that due to the presence of NaN, Float's Ord instance does not satisfy reflexivity.>>> 0/0 <= (0/0 :: Float) False Also note that, due to the same, Ord's operator interactions are not respected by Float's instance:>>> (0/0 :: Float) > 1 False >>> compare (0/0 :: Float) 1 GT  Instance detailsDefined in GHC.Classes Methods(<) :: Float -> Float -> Bool #(<=) :: Float -> Float -> Bool #(>) :: Float -> Float -> Bool #(>=) :: Float -> Float -> Bool #max :: Float -> Float -> Float #min :: Float -> Float -> Float # Instance detailsDefined in GHC.Classes Methodscompare :: Int -> Int -> Ordering #(<) :: Int -> Int -> Bool #(<=) :: Int -> Int -> Bool #(>) :: Int -> Int -> Bool #(>=) :: Int -> Int -> Bool #max :: Int -> Int -> Int #min :: Int -> Int -> Int # Instance detailsDefined in GHC.Integer.Type Methods(<) :: Integer -> Integer -> Bool #(<=) :: Integer -> Integer -> Bool #(>) :: Integer -> Integer -> Bool #(>=) :: Integer -> Integer -> Bool # Since: base-4.8.0.0 Instance detailsDefined in GHC.Natural Methods(<) :: Natural -> Natural -> Bool #(<=) :: Natural -> Natural -> Bool #(>) :: Natural -> Natural -> Bool #(>=) :: Natural -> Natural -> Bool # Instance detailsDefined in GHC.Classes Methods(<) :: Ordering -> Ordering -> Bool #(>) :: Ordering -> Ordering -> Bool # Instance detailsDefined in GHC.Classes Methodscompare :: Word -> Word -> Ordering #(<) :: Word -> Word -> Bool #(<=) :: Word -> Word -> Bool #(>) :: Word -> Word -> Bool #(>=) :: Word -> Word -> Bool #max :: Word -> Word -> Word #min :: Word -> Word -> Word # Ord () Instance detailsDefined in GHC.Classes Methodscompare :: () -> () -> Ordering #(<) :: () -> () -> Bool #(<=) :: () -> () -> Bool #(>) :: () -> () -> Bool #(>=) :: () -> () -> Bool #max :: () -> () -> () #min :: () -> () -> () # Instance detailsDefined in GHC.Classes Methods(<) :: TyCon -> TyCon -> Bool #(<=) :: TyCon -> TyCon -> Bool #(>) :: TyCon -> TyCon -> Bool #(>=) :: TyCon -> TyCon -> Bool #max :: TyCon -> TyCon -> TyCon #min :: TyCon -> TyCon -> TyCon # Instance detailsDefined in GHC.Integer.Type Methods(<) :: BigNat -> BigNat -> Bool #(<=) :: BigNat -> BigNat -> Bool #(>) :: BigNat -> BigNat -> Bool #(>=) :: BigNat -> BigNat -> Bool #max :: BigNat -> BigNat -> BigNat #min :: BigNat -> BigNat -> BigNat # Ord a => Ord [a] Instance detailsDefined in GHC.Classes Methodscompare :: [a] -> [a] -> Ordering #(<) :: [a] -> [a] -> Bool #(<=) :: [a] -> [a] -> Bool #(>) :: [a] -> [a] -> Bool #(>=) :: [a] -> [a] -> Bool #max :: [a] -> [a] -> [a] #min :: [a] -> [a] -> [a] # Ord a => Ord (Maybe a) Since: base-2.1 Instance detailsDefined in GHC.Maybe Methodscompare :: Maybe a -> Maybe a -> Ordering #(<) :: Maybe a -> Maybe a -> Bool #(<=) :: Maybe a -> Maybe a -> Bool #(>) :: Maybe a -> Maybe a -> Bool #(>=) :: Maybe a -> Maybe a -> Bool #max :: Maybe a -> Maybe a -> Maybe a #min :: Maybe a -> Maybe a -> Maybe a # Integral a => Ord (Ratio a) Since: base-2.0.1 Instance detailsDefined in GHC.Real Methodscompare :: Ratio a -> Ratio a -> Ordering #(<) :: Ratio a -> Ratio a -> Bool #(<=) :: Ratio a -> Ratio a -> Bool #(>) :: Ratio a -> Ratio a -> Bool #(>=) :: Ratio a -> Ratio a -> Bool #max :: Ratio a -> Ratio a -> Ratio a #min :: Ratio a -> Ratio a -> Ratio a # Ord a => Ord (NonEmpty a) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodscompare :: NonEmpty a -> NonEmpty a -> Ordering #(<) :: NonEmpty a -> NonEmpty a -> Bool #(<=) :: NonEmpty a -> NonEmpty a -> Bool #(>) :: NonEmpty a -> NonEmpty a -> Bool #(>=) :: NonEmpty a -> NonEmpty a -> Bool #max :: NonEmpty a -> NonEmpty a -> NonEmpty a #min :: NonEmpty a -> NonEmpty a -> NonEmpty a # (Ord a, Ord b) => Ord (a, b) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b) -> (a, b) -> Ordering #(<) :: (a, b) -> (a, b) -> Bool #(<=) :: (a, b) -> (a, b) -> Bool #(>) :: (a, b) -> (a, b) -> Bool #(>=) :: (a, b) -> (a, b) -> Bool #max :: (a, b) -> (a, b) -> (a, b) #min :: (a, b) -> (a, b) -> (a, b) # (Ord a, Ord b, Ord c) => Ord (a, b, c) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c) -> (a, b, c) -> Ordering #(<) :: (a, b, c) -> (a, b, c) -> Bool #(<=) :: (a, b, c) -> (a, b, c) -> Bool #(>) :: (a, b, c) -> (a, b, c) -> Bool #(>=) :: (a, b, c) -> (a, b, c) -> Bool #max :: (a, b, c) -> (a, b, c) -> (a, b, c) #min :: (a, b, c) -> (a, b, c) -> (a, b, c) # (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d) -> (a, b, c, d) -> Ordering #(<) :: (a, b, c, d) -> (a, b, c, d) -> Bool #(<=) :: (a, b, c, d) -> (a, b, c, d) -> Bool #(>) :: (a, b, c, d) -> (a, b, c, d) -> Bool #(>=) :: (a, b, c, d) -> (a, b, c, d) -> Bool #max :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #min :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) # (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e) -> (a, b, c, d, e) -> Ordering #(<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #(<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #(>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #(>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #max :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #min :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Ordering #(<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #(<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #(>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #(>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #max :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #min :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Ordering #(<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #(<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #(>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #(>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #max :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #min :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Ordering #(<) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #(<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #(>) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #(>=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #max :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #min :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Ordering #(<) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #(<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #(>) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #(>=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #max :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #min :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Ordering #(<) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #(<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #(>) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #(>=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #max :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #min :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Ordering #(<) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #(<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #(>) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #(>=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #max :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #min :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Ordering #(<) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #(>) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #max :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #min :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Ordering #(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #max :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) #min :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Ordering #(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Instance detailsDefined in GHC.Classes Methodscompare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Ordering #(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #

class Num a #

Basic numeric class.

The Haskell Report defines no laws for Num. However, '(+)' and '(*)' are customarily expected to define a ring and have the following properties:

Associativity of (+)
(x + y) + z = x + (y + z)
Commutativity of (+)
x + y = y + x
fromInteger 0 is the additive identity
x + fromInteger 0 = x
negate gives the additive inverse
x + negate x = fromInteger 0
Associativity of (*)
(x * y) * z = x * (y * z)
fromInteger 1 is the multiplicative identity
x * fromInteger 1 = x and fromInteger 1 * x = x
Distributivity of (*) with respect to (+)
a * (b + c) = (a * b) + (a * c) and (b + c) * a = (b * a) + (c * a)

Note that it isn't customarily expected that a type instance of both Num and Ord implement an ordered ring. Indeed, in base only Integer and Rational do.

Minimal complete definition

(+), (*), abs, signum, fromInteger, (negate | (-))

Instances
 Since: base-2.1 Instance detailsDefined in GHC.Num Methods(+) :: Int -> Int -> Int #(-) :: Int -> Int -> Int #(*) :: Int -> Int -> Int #negate :: Int -> Int #abs :: Int -> Int #signum :: Int -> Int # Since: base-2.1 Instance detailsDefined in GHC.Num Methods Note that Natural's Num instance isn't a ring: no element but 0 has an additive inverse. It is a semiring though.Since: base-4.8.0.0 Instance detailsDefined in GHC.Num Methods Since: base-2.1 Instance detailsDefined in GHC.Num Methods(+) :: Word -> Word -> Word #(-) :: Word -> Word -> Word #(*) :: Word -> Word -> Word #negate :: Word -> Word #abs :: Word -> Word #signum :: Word -> Word # Integral a => Num (Ratio a) Since: base-2.0.1 Instance detailsDefined in GHC.Real Methods(+) :: Ratio a -> Ratio a -> Ratio a #(-) :: Ratio a -> Ratio a -> Ratio a #(*) :: Ratio a -> Ratio a -> Ratio a #negate :: Ratio a -> Ratio a #abs :: Ratio a -> Ratio a #signum :: Ratio a -> Ratio a #

class Num a => Fractional a #

Fractional numbers, supporting real division.

The Haskell Report defines no laws for Fractional. However, '(+)' and '(*)' are customarily expected to define a division ring and have the following properties:

recip gives the multiplicative inverse
x * recip x = recip x * x = fromInteger 1

Note that it isn't customarily expected that a type instance of Fractional implement a field. However, all instances in base do.

Minimal complete definition

fromRational, (recip | (/))

Instances
 Integral a => Fractional (Ratio a) Since: base-2.0.1 Instance detailsDefined in GHC.Real Methods(/) :: Ratio a -> Ratio a -> Ratio a #recip :: Ratio a -> Ratio a #

class Show a #

Conversion of values to readable Strings.

Derived instances of Show have the following properties, which are compatible with derived instances of Read:

• The result of show is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used.
• If the constructor is defined to be an infix operator, then showsPrec will produce infix applications of the constructor.
• the representation will be enclosed in parentheses if the precedence of the top-level constructor in x is less than d (associativity is ignored). Thus, if d is 0 then the result is never surrounded in parentheses; if d is 11 it is always surrounded in parentheses, unless it is an atomic expression.
• If the constructor is defined using record syntax, then show will produce the record-syntax form, with the fields given in the same order as the original declaration.

For example, given the declarations

infixr 5 :^:
data Tree a =  Leaf a  |  Tree a :^: Tree a

the derived instance of Show is equivalent to

instance (Show a) => Show (Tree a) where

showsPrec d (Leaf m) = showParen (d > app_prec) $showString "Leaf " . showsPrec (app_prec+1) m where app_prec = 10 showsPrec d (u :^: v) = showParen (d > up_prec)$
showsPrec (up_prec+1) u .
showString " :^: "      .
showsPrec (up_prec+1) v
where up_prec = 5

Note that right-associativity of :^: is ignored. For example,

• show (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the string "Leaf 1 :^: (Leaf 2 :^: Leaf 3)".

Minimal complete definition

Instances
 Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> Bool -> ShowS #show :: Bool -> String #showList :: [Bool] -> ShowS # Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> Char -> ShowS #show :: Char -> String #showList :: [Char] -> ShowS # Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> Int -> ShowS #show :: Int -> String #showList :: [Int] -> ShowS # Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowList :: [Integer] -> ShowS # Since: base-4.8.0.0 Instance detailsDefined in GHC.Show MethodsshowList :: [Natural] -> ShowS # Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowList :: [Ordering] -> ShowS # Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> Word -> ShowS #show :: Word -> String #showList :: [Word] -> ShowS # Since: base-4.11.0.0 Instance detailsDefined in GHC.Show MethodsshowList :: [RuntimeRep] -> ShowS # Since: base-4.11.0.0 Instance detailsDefined in GHC.Show MethodsshowList :: [VecCount] -> ShowS # Since: base-4.11.0.0 Instance detailsDefined in GHC.Show MethodsshowList :: [VecElem] -> ShowS # Since: base-4.9.0.0 Instance detailsDefined in GHC.Show MethodsshowList :: [CallStack] -> ShowS # Show () Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> () -> ShowS #show :: () -> String #showList :: [()] -> ShowS # Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> TyCon -> ShowS #show :: TyCon -> String #showList :: [TyCon] -> ShowS # Since: base-4.9.0.0 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> Module -> ShowS #showList :: [Module] -> ShowS # Since: base-4.9.0.0 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> TrName -> ShowS #showList :: [TrName] -> ShowS # Instance detailsDefined in GHC.Show MethodsshowList :: [KindRep] -> ShowS # Since: base-4.11.0.0 Instance detailsDefined in GHC.Show MethodsshowList :: [TypeLitSort] -> ShowS # Since: base-4.9.0.0 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> SrcLoc -> ShowS #showList :: [SrcLoc] -> ShowS # Show a => Show [a] Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> [a] -> ShowS #show :: [a] -> String #showList :: [[a]] -> ShowS # Show a => Show (Maybe a) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> Maybe a -> ShowS #show :: Maybe a -> String #showList :: [Maybe a] -> ShowS # Show a => Show (Ratio a) Since: base-2.0.1 Instance detailsDefined in GHC.Real MethodsshowsPrec :: Int -> Ratio a -> ShowS #show :: Ratio a -> String #showList :: [Ratio a] -> ShowS # Show a => Show (NonEmpty a) Since: base-4.11.0.0 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> NonEmpty a -> ShowS #show :: NonEmpty a -> String #showList :: [NonEmpty a] -> ShowS # (Show a, Show b) => Show (a, b) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b) -> ShowS #show :: (a, b) -> String #showList :: [(a, b)] -> ShowS # (Show a, Show b, Show c) => Show (a, b, c) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c) -> ShowS #show :: (a, b, c) -> String #showList :: [(a, b, c)] -> ShowS # (Show a, Show b, Show c, Show d) => Show (a, b, c, d) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d) -> ShowS #show :: (a, b, c, d) -> String #showList :: [(a, b, c, d)] -> ShowS # (Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e) -> ShowS #show :: (a, b, c, d, e) -> String #showList :: [(a, b, c, d, e)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e, f) -> ShowS #show :: (a, b, c, d, e, f) -> String #showList :: [(a, b, c, d, e, f)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g) -> ShowS #show :: (a, b, c, d, e, f, g) -> String #showList :: [(a, b, c, d, e, f, g)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h) -> ShowS #show :: (a, b, c, d, e, f, g, h) -> String #showList :: [(a, b, c, d, e, f, g, h)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i) -> ShowS #show :: (a, b, c, d, e, f, g, h, i) -> String #showList :: [(a, b, c, d, e, f, g, h, i)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k, l) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k, l)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] -> ShowS #

data Integer #

Invariant: Jn# and Jp# are used iff value doesn't fit in S#

Useful properties resulting from the invariants:

• abs (S# _) <= abs (Jp# _)
• abs (S# _) <  abs (Jn# _)
Instances
 Instance detailsDefined in GHC.Integer.Type Methods(==) :: Integer -> Integer -> Bool #(/=) :: Integer -> Integer -> Bool # Since: base-2.0.1 Instance detailsDefined in GHC.Real MethodsquotRem :: Integer -> Integer -> (Integer, Integer) #divMod :: Integer -> Integer -> (Integer, Integer) # Since: base-2.1 Instance detailsDefined in GHC.Num Methods Instance detailsDefined in GHC.Integer.Type Methods(<) :: Integer -> Integer -> Bool #(<=) :: Integer -> Integer -> Bool #(>) :: Integer -> Integer -> Bool #(>=) :: Integer -> Integer -> Bool # Since: base-2.0.1 Instance detailsDefined in GHC.Real Methods Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowList :: [Integer] -> ShowS #

data Natural #

Type representing arbitrary-precision non-negative integers.

>>> 2^100 :: Natural
1267650600228229401496703205376


Operations whose result would be negative throw (Underflow :: ArithException),

>>> -1 :: Natural
*** Exception: arithmetic underflow


Since: base-4.8.0.0

Instances
 Since: base-4.8.0.0 Instance detailsDefined in GHC.Natural Methods(==) :: Natural -> Natural -> Bool #(/=) :: Natural -> Natural -> Bool # Since: base-4.8.0.0 Instance detailsDefined in GHC.Real MethodsquotRem :: Natural -> Natural -> (Natural, Natural) #divMod :: Natural -> Natural -> (Natural, Natural) # Note that Natural's Num instance isn't a ring: no element but 0 has an additive inverse. It is a semiring though.Since: base-4.8.0.0 Instance detailsDefined in GHC.Num Methods Since: base-4.8.0.0 Instance detailsDefined in GHC.Natural Methods(<) :: Natural -> Natural -> Bool #(<=) :: Natural -> Natural -> Bool #(>) :: Natural -> Natural -> Bool #(>=) :: Natural -> Natural -> Bool # Since: base-4.8.0.0 Instance detailsDefined in GHC.Real Methods Since: base-4.8.0.0 Instance detailsDefined in GHC.Show MethodsshowList :: [Natural] -> ShowS #

module GHC.Types