-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Gray encoding schemes
--
-- Gray codes satisfy the property that two successive values differ in
-- only one digit. Usually the term "Gray code" refers to the Binary
-- Reflected Gray code (BRGC), but non-binary Gray codes have also been
-- discovered.
@package gray-extended
@version 1.3
-- | Gray encoding schemes. A Gray code is a list of values such that two
-- successive values differ in only one digit. Usually the term /Gray
-- code/ refers to the Binary Reflected Gray code (BRGC), but non-binary
-- Gray codes have also been discovered. Some Gray codes are also
-- cyclic: the last and first values differ in only one digit.
module Codec.Gray
-- | grayCodes k generates the list of Binary Reflected
-- Gray Code (BRGC) numbers of length k. This code is cyclic.
grayCodes :: Int -> [[Bool]]
-- | naryGrayCodes xs k generates a non-Boolean (or n-ary)
-- Gray code of length k using the elements of x as
-- digits. This code is cyclic.
--
-- Ex: naryGrayCodes "012" 4 generates a ternary Gray
-- code that is four digits long.
naryGrayCodes :: [a] -> Int -> [[a]]