tuple-gen-2.0: Enum instances for tuples where the digits increase with the same speed

Data.Tuple.Enum

Synopsis

# Documentation

all2s :: (Enum a, Enum b, Eq a, Eq b, Bounded a, Bounded b) => [(a, b)]Source

generate all 2-tuples (of enumerable values) so that the sum of the 2 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all3s :: (Enum a, Enum b, Enum c, Eq a, Eq b, Eq c, Bounded a, Bounded b, Bounded c) => [(a, b, c)]Source

generate all 3-tuples (of enumerable values) so that the sum of the 3 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all4s :: (Enum a, Enum b, Enum c, Enum d, Eq a, Eq b, Eq c, Eq d, Bounded a, Bounded b, Bounded c, Bounded d) => [(a, b, c, d)]Source

generate all 4-tuples (of enumerable values) so that the sum of the 4 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all5s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Eq a, Eq b, Eq c, Eq d, Eq e, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => [(a, b, c, d, e)]Source

generate all 5-tuples (of enumerable values) so that the sum of the 5 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all6s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => [(a, b, c, d, e, f)]Source

generate all 6-tuples (of enumerable values) so that the sum of the 6 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all7s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g) => [(a, b, c, d, e, f, g)]Source

generate all 7-tuples (of enumerable values) so that the sum of the 7 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all8s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h) => [(a, b, c, d, e, f, g, h)]Source

generate all 8-tuples (of enumerable values) so that the sum of the 8 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all9s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i) => [(a, b, c, d, e, f, g, h, i)]Source

generate all 9-tuples (of enumerable values) so that the sum of the 9 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all10s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j) => [(a, b, c, d, e, f, g, h, i, j)]Source

generate all 10-tuples (of enumerable values) so that the sum of the 10 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all11s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Enum k, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k) => [(a, b, c, d, e, f, g, h, i, j, k)]Source

generate all 11-tuples (of enumerable values) so that the sum of the 11 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all12s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Enum k, Enum l, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l) => [(a, b, c, d, e, f, g, h, i, j, k, l)]Source

generate all 12-tuples (of enumerable values) so that the sum of the 12 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all13s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Enum k, Enum l, Enum m, 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, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m) => [(a, b, c, d, e, f, g, h, i, j, k, l, m)]Source

generate all 13-tuples (of enumerable values) so that the sum of the 13 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all14s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Enum k, Enum l, Enum m, Enum n, 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, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n) => [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)]Source

generate all 14-tuples (of enumerable values) so that the sum of the 14 fromEnum-values is monotonic increasing fromEnum :: a -> Int

all15s :: (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Enum k, Enum l, Enum m, Enum n, Enum o, 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, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n, Bounded o) => [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)]Source

generate all 15-tuples (of enumerable values) so that the sum of the 15 fromEnum-values is monotonic increasing fromEnum :: a -> Int

fe :: [Int] -> IntSource

te :: Int -> Int -> [Int]Source

to2Tuple :: (J t, J t1) -> (t, t1)Source

to3Tuple :: ((J t, J t1), J t2) -> (t, t1, t2)Source

to4Tuple :: (((J t, J t1), J t2), J t3) -> (t, t1, t2, t3)Source

to5Tuple :: ((((J t, J t1), J t2), J t3), J t4) -> (t, t1, t2, t3, t4)Source

to6Tuple :: (((((J t, J t1), J t2), J t3), J t4), J t5) -> (t, t1, t2, t3, t4, t5)Source

to7Tuple :: ((((((J t, J t1), J t2), J t3), J t4), J t5), J t6) -> (t, t1, t2, t3, t4, t5, t6)Source

to8Tuple :: (((((((J t, J t1), J t2), J t3), J t4), J t5), J t6), J t7) -> (t, t1, t2, t3, t4, t5, t6, t7)Source

to9Tuple :: ((((((((J t, J t1), J t2), J t3), J t4), J t5), J t6), J t7), J t8) -> (t, t1, t2, t3, t4, t5, t6, t7, t8)Source

to10Tuple :: (((((((((J t, J t1), J t2), J t3), J t4), J t5), J t6), J t7), J t8), J t9) -> (t, t1, t2, t3, t4, t5, t6, t7, t8, t9)Source

to11Tuple :: ((((((((((J t, J t1), J t2), J t3), J t4), J t5), J t6), J t7), J t8), J t9), J t10) -> (t, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)Source

to12Tuple :: (((((((((((J t, J t1), J t2), J t3), J t4), J t5), J t6), J t7), J t8), J t9), J t10), J t11) -> (t, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11)Source

to13Tuple :: ((((((((((((J t, J t1), J t2), J t3), J t4), J t5), J t6), J t7), J t8), J t9), J t10), J t11), J t12) -> (t, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12)Source

to14Tuple :: (((((((((((((J t, J t1), J t2), J t3), J t4), J t5), J t6), J t7), J t8), J t9), J t10), J t11), J t12), J t13) -> (t, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13)Source

to15Tuple :: ((((((((((((((J t, J t1), J t2), J t3), J t4), J t5), J t6), J t7), J t8), J t9), J t10), J t11), J t12), J t13), J t14) -> (t, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14)Source

from2Tuple :: (a, a1) -> (J a, J a1)Source

from3Tuple :: (a, a1, a2) -> ((J a, J a1), J a2)Source

from4Tuple :: (a, a1, a2, a3) -> (((J a, J a1), J a2), J a3)Source

from5Tuple :: (a, a1, a2, a3, a4) -> ((((J a, J a1), J a2), J a3), J a4)Source

from6Tuple :: (a, a1, a2, a3, a4, a5) -> (((((J a, J a1), J a2), J a3), J a4), J a5)Source

from7Tuple :: (a, a1, a2, a3, a4, a5, a6) -> ((((((J a, J a1), J a2), J a3), J a4), J a5), J a6)Source

from8Tuple :: (a, a1, a2, a3, a4, a5, a6, a7) -> (((((((J a, J a1), J a2), J a3), J a4), J a5), J a6), J a7)Source

from9Tuple :: (a, a1, a2, a3, a4, a5, a6, a7, a8) -> ((((((((J a, J a1), J a2), J a3), J a4), J a5), J a6), J a7), J a8)Source

from10Tuple :: (a, a1, a2, a3, a4, a5, a6, a7, a8, a9) -> (((((((((J a, J a1), J a2), J a3), J a4), J a5), J a6), J a7), J a8), J a9)Source

from11Tuple :: (a, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -> ((((((((((J a, J a1), J a2), J a3), J a4), J a5), J a6), J a7), J a8), J a9), J a10)Source

from12Tuple :: (a, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) -> (((((((((((J a, J a1), J a2), J a3), J a4), J a5), J a6), J a7), J a8), J a9), J a10), J a11)Source

from13Tuple :: (a, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) -> ((((((((((((J a, J a1), J a2), J a3), J a4), J a5), J a6), J a7), J a8), J a9), J a10), J a11), J a12)Source

from14Tuple :: (a, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) -> (((((((((((((J a, J a1), J a2), J a3), J a4), J a5), J a6), J a7), J a8), J a9), J a10), J a11), J a12), J a13)Source

from15Tuple :: (a, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) -> ((((((((((((((J a, J a1), J a2), J a3), J a4), J a5), J a6), J a7), J a8), J a9), J a10), J a11), J a12), J a13), J a14)Source

class Enum a where

Class Enum defines operations on sequentially ordered types.

The enumFrom... methods are used in Haskell's translation of arithmetic sequences.

Instances of Enum may be derived for any enumeration type (types whose constructors have no fields). The nullary constructors are assumed to be numbered left-to-right by fromEnum from 0 through n-1. See Chapter 10 of the Haskell Report for more details.

For any type that is an instance of class Bounded as well as Enum, the following should hold:

enumFrom     x   = enumFromTo     x maxBound
enumFromThen x y = enumFromThenTo x y bound
where
| otherwise                = minBound

Methods

succ :: a -> a

the successor of a value. For numeric types, succ adds 1.

pred :: a -> a

the predecessor of a value. For numeric types, pred subtracts 1.

toEnum :: Int -> a

Convert from an Int.

Convert to an Int. It is implementation-dependent what fromEnum returns when applied to a value that is too large to fit in an Int.

enumFrom :: a -> [a]

Used in Haskell's translation of [n..].

enumFromThen :: a -> a -> [a]

Used in Haskell's translation of [n,n'..].

enumFromTo :: a -> a -> [a]

Used in Haskell's translation of [n..m].

enumFromThenTo :: a -> a -> a -> [a]

Used in Haskell's translation of [n,n'..m].

Instances

 Enum Bool Enum Char Enum Double Enum Float Enum Int Enum Integer Enum Ordering Enum () Integral a => Enum (Ratio a) (Enum a, Enum b, Eq a, Eq b, Bounded a, Bounded b) => Enum (a, b) (Enum a, Enum b, Enum c, Eq a, Eq b, Eq c, Bounded a, Bounded b, Bounded c) => Enum (a, b, c) (Enum a, Enum b, Enum c, Enum d, Eq a, Eq b, Eq c, Eq d, Bounded a, Bounded b, Bounded c, Bounded d) => Enum (a, b, c, d) (Enum a, Enum b, Enum c, Enum d, Enum e, Eq a, Eq b, Eq c, Eq d, Eq e, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Enum (a, b, c, d, e) (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => Enum (a, b, c, d, e, f) (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g) => Enum (a, b, c, d, e, f, g) (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h) => Enum (a, b, c, d, e, f, g, h) (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i) => Enum (a, b, c, d, e, f, g, h, i) (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j) => Enum (a, b, c, d, e, f, g, h, i, j) (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Enum k, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k) => Enum (a, b, c, d, e, f, g, h, i, j, k) (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Enum k, Enum l, Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l) => Enum (a, b, c, d, e, f, g, h, i, j, k, l) (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Enum k, Enum l, Enum m, 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, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m) => Enum (a, b, c, d, e, f, g, h, i, j, k, l, m) (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Enum k, Enum l, Enum m, Enum n, 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, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n) => Enum (a, b, c, d, e, f, g, h, i, j, k, l, m, n) (Enum a, Enum b, Enum c, Enum d, Enum e, Enum f, Enum g, Enum h, Enum i, Enum j, Enum k, Enum l, Enum m, Enum n, Enum o, 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, Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n, Bounded o) => Enum (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)