Copyright | (c) Eric Bailey 2025 |
---|---|
License | MIT |
Maintainer | eric@ericb.me |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Data.Rhythm.Binary.BurrowsWheeler
Description
Binary necklaces via the set of Lyndon words generated by an inverse Burrows-Wheeler transform. Modified from Rosetta Code.
Documentation
necklaces :: Int -> [[Int]] Source #
All binary necklaces of a given length.
>>>
necklaces 4
[[1,1,1,1],[1,1,1,0],[1,1,0,0],[1,0,1,0],[1,0,0,0],[0,0,0,0]]
lyndonWords :: Ord a => [a] -> Int -> [[a]] Source #
The set of Lyndon words generated by an inverse Burrows-Wheeler transform.
>>>
lyndonWords [0,1] 4
[[0],[0,0,0,1],[0,0,1,1],[0,1],[0,1,1,1],[1]]