@hackage tuple-gen2.0

Enum instances for tuples where the digits increase with the same speed

  • Categories

    • License

      BSD-3-Clause

    • Maintainer

      Tillmann.Vogt@rwth-aachen.de

    • Versions

      • 2.0 Sun, 11 Mar 2012
      • 1.1 Sun, 17 Apr 2011
      • 1.0 Tue, 18 Jan 2011

    Generating tuples like this: [(x, y) | x <- [1..], y <- [1..]] generates tuples that change only in the second position.

    This library uses increasingly bigger hyperplanes to generate tuples.

    It uses the Enum instances that are also used in the Prelude.

    Thereby tuples with arbitrary starting values and types can be enumerated.

    Example: ( enumFrom (0,(1,2),3) ) :: [(Word8,(Word8,Word8),Word8)]

    evaluates to [(0,(1,2),3), (0,(2,1),4), (0,(3,0),5), ...].

    Further explanations are planned to appear in the Monad Reader issue 20.