1 comments

  • ptspts47 days ago
    What is the advantage of this circular implementation?<p>Is it faster than the simple one? Does it use less memory? Is it easier to write? Is it easier to understand?<p>I think all of the above is false, but I have a limited understanding of Haskell. Please correct me if I&#x27;m wrong.
    • TacticalCoder47 days ago
      &gt; The algorithm isn’t single-pass in the sense of Adaptive Huffman Coding: it still uses the normal Huffman algorithm, but the input is transformed in the same traversal that builds the tree to transform it.<p>Limited understanding here too. Sounds like it&#x27;s not really single pass anyway so it&#x27;s not usable to process a stream in real-time either, before having all the data?
    • oisdk45 days ago
      There&#x27;s no (practical) advantage to the circular implementation; it&#x27;s just a curiosity.<p>It is useful for understanding laziness and some interesting theoretical tools for traversing data structures, though. For a more in-depth look at the idea of circular programs for traversal, Bird&#x27;s paper (linked in the post, <a href="https:&#x2F;&#x2F;link.springer.com&#x2F;article&#x2F;10.1007&#x2F;BF00264249" rel="nofollow">https:&#x2F;&#x2F;link.springer.com&#x2F;article&#x2F;10.1007&#x2F;BF00264249</a>) is a good start.
    • viraptor47 days ago
      It&#x27;s a weird claim about a single pass too. It&#x27;s more of a &quot;let&#x27;s replace some iteration with building a tree of functions to call&quot; and then pretends waking&#x2F;executing that is not another pass.