Int package:hedgehog

A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]. The exact range for a given implementation can be determined by using minBound and maxBound from the Bounded class.
Generates a random machine integer in the given [inclusive,inclusive] range. This is a specialization of integral, offered for convenience.
Arbitrary precision integers. In contrast with fixed-size integral types such as Int, the Integer type represents the entire infinite range of integers. Integers are stored in a kind of sign-magnitude form, hence do not expect two's complement form when using bit operations. If the value is small (fit into an Int), IS constructor is used. Otherwise Integer and IN constructors are used to store a BigNat representing respectively the positive or the negative value magnitude. Invariant: Integer and IN are used iff value doesn't fit in IS
Integral numbers, supporting integer division. The Haskell Report defines no laws for Integral. However, Integral instances are customarily expected to define a Euclidean domain and have the following properties for the div/mod and quot/rem pairs, given suitable Euclidean functions f and g:
  • x = y * quot x y + rem x y with rem x y = fromInteger 0 or g (rem x y) < g y
  • x = y * div x y + mod x y with mod x y = fromInteger 0 or f (mod x y) < f y
An example of a suitable Euclidean function, for Integer's instance, is abs. In addition, toInteger should be total, and fromInteger should be a left inverse for it, i.e. fromInteger (toInteger i) = i.
Non-negative integer
Generates a random 16-bit integer in the given [inclusive,inclusive] range. This is a specialization of integral, offered for convenience.
Generates a random 32-bit integer in the given [inclusive,inclusive] range. This is a specialization of integral, offered for convenience.
Generates a random 64-bit integer in the given [inclusive,inclusive] range. This is a specialization of integral, offered for convenience.
Generates a random 8-bit integer in the given [inclusive,inclusive] range. This is a specialization of integral, offered for convenience.
Generates a random integral number in the given [inclusive,inclusive] range. When the generator tries to shrink, it will shrink towards the origin of the specified Range. For example, the following generator will produce a number between 1970 and 2100, but will shrink towards 2000:
integral (Range.constantFrom 2000 1970 2100) :: Gen Int
Some sample outputs from this generator might look like:
=== Outcome ===
1973
=== Shrinks ===
2000
1987
1980
1976
1974
=== Outcome ===
2061
=== Shrinks ===
2000
2031
2046
2054
2058
2060
Generates a random integral number in the [inclusive,inclusive] range. This generator does not shrink.
The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.
Run a generator with a random seed and print the outcome, and the first level of shrinks.
Gen.print (Gen.enum 'a' 'f')
=== Outcome ===
'd'
=== Shrinks ===
'a'
'b'
'c'
Run a generator with a random seed and print the resulting shrink tree.
Gen.printTree (Gen.enum 'a' 'f')
'd'
├╼'a'
├╼'b'
│  └╼'a'
└╼'c'
├╼'a'
└╼'b'
└╼'a'
This may not terminate when the tree is very large.
Print the shrink tree produced by a generator, for the given size and seed. Use printTree to generate a value from a random seed.
Print the value produced by a generator, and the first level of shrinks, for the given size and seed. Use print to generate a value from a random seed.
Conversion from an Integer. An integer literal represents the application of the function fromInteger to the appropriate value of type Integer, so such literals have type (Num a) => a.
General coercion from Integral types. WARNING: This function performs silent truncation if the result type is not at least as big as the argument's type.
conversion to Integer
The minimum amount of tests to run for a Property
Whether to add icons to the start of important output lines or not.