const package:hedgehog

const x y always evaluates to x, ignoring its second argument.
>>> const 42 "hello"
42
>>> map (const 42) [0..3]
[42,42,42,42]
Trivial generator that always produces the same element. This is another name for pure / return.
Construct a range which is unaffected by the size parameter. A range from 0 to 10, with the origin at 0:
>>> bounds x $ constant 0 10
(0,10)
>>> origin $ constant 0 10
0
Construct a range which is unaffected by the size parameter using the full range of a data type. A range from -128 to 127, with the origin at 0:
>>> bounds x (constantBounded :: Range Int8)
(-128,127)
>>> origin (constantBounded :: Range Int8)
0
Construct a range which is unaffected by the size parameter with a origin point which may differ from the bounds. A range from -10 to 10, with the origin at 0:
>>> bounds x $ constantFrom 0 (-10) 10
(-10,10)
>>> origin $ constantFrom 0 (-10) 10
0
A range from 1970 to 2100, with the origin at 2000:
>>> bounds x $ constantFrom 2000 1970 2100
(1970,2100)
>>> origin $ constantFrom 2000 1970 2100
2000