Richard S. Bird, Jeremy Gibbons: Arithmetic Coding with Folds and Unfolds. Advanced Functional Programming 2002: 1-26