<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="310131" data-post-id="310131">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="greven" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/greven/120/25004_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  greven
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The block solution is my preferred. Looks cleaner and it’s more obvious what is going on.</p>
<p>/chefs kiss</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310131" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/local-accumulators-for-cleaner-comprehensions/60130/104">Post #103</a>
	                </div>
	            </div>
              <div id="likers-container-310131" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310131"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #103"></div>
  </section>
</div>
    <div class="postbit" id="310141" data-post-id="310141">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="marciol" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/marciol/120/4223_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  marciol
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="95" data-topic="60130">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>A compromise would be a block:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">accum session_counter &lt;- 0, lesson_counter &lt;- 0 do
  ...
end
</code></pre>
<p>It has benefits from both approaches:</p>
<ol>
<li>The block helps limit the scope of where the variables are used, so we worry less about large functions</li>
<li>No additional syntax noise such as <code>@@</code> (although that can be a cons as usage is less clear)</li>
</ol>
<p>It also helps keep the theme that all of <code>for</code>, <code>with</code>, and then <code>accum</code> are actually monads (but let’s not call them that <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20">).</p>
</blockquote>
</aside>
<p>I liked the idea, but what about make it more general and call it <code>let</code> instead of <code>accum</code>, in a way that allows the same mechanism in a specific closed scope. I know that this resembles a closure mechanism, that would be useful in several ways, not only when using comprehensions.</p>
<p>EDIT:</p>
<p>There is an <a href="https://forum.elixirforum.com/t/introducing-for-let-and-for-reduce/44773" rel="nofollow">old proposal</a> that seems to go in the same direction, but why not just make it more general, it would be useful   and really explicit because any reference to that scoped variables outside a let block would be caught by Elixir compiler.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310141" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/local-accumulators-for-cleaner-comprehensions/60130/107">Post #106</a>
	                </div>
	            </div>
              <div id="likers-container-310141" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310141"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #106"></div>
  </section>
</div>
    <div class="postbit" id="310150" data-post-id="310150">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="christhekeele" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/120/1039_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  christhekeele
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="1" data-topic="60130">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>With local accumulators, we can instead write:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">@@value = 123
</code></pre>
</blockquote>
</aside>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="95" data-topic="60130">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>A compromise would be a block:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">accum session_counter &lt;- 0, lesson_counter &lt;- 0 do
  ...
end
</code></pre>
</blockquote>
</aside>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="95" data-topic="60130">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>Of course, the other option is to introduce the accumulators directly into comprehensions</p>
</blockquote>
</aside>
<p>Another option for a new syntax construct occurs to me, if (as this proposal seems to be uniquely focused on) you want to define local accumulators for any block. We could add to the family of special keywords <code>do</code>/<code>end</code> supports like <code>else</code>/<code>catch</code>/<code>rescue</code>/<code>finally</code>, say, <code>acc</code>.</p>
<p>This provides little value in the simplest <code>if</code> use-case, where you may as well use the <code>else</code> instead, but perhaps is nicer for complex cases and the <code>for</code> use-case.</p>
<p><code>else</code> in <code>with</code> and <code>catch</code> in <code>try</code>/<code>def</code> already have precedence for accepting clauses and matching variables with <code>-&gt;</code>. Perhaps we could accept clauses with the generator <code>&lt;-</code> to indicate “generating” out into the external scope. So:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">sum = 0

list =
  for element &lt;- [1, 2, 3] do
    sum = element + sum
    element * 2
  acc
    sum &lt;- sum
  end

list #=&gt; [2, 4, 6]
sum #=&gt; 6
</code></pre>
<p>This syntax says to me “after evaluating this block (however many times, each time for <code>for</code>) update the binding of the variable <code>sum</code> with the current value of <code>sum</code>, either before returning or iterating again.”</p>
<p>It allows for providing multiple reassignments with mulitple clauses, and doing other intermediate manipulations. Say,</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">i = 0

list = for element &lt;- [1, 2, 3] do
    element * i
  acc
    i &lt;- i + 1
  end

list #=&gt; [0, 2, 6]
i #=&gt; 3 (or 2?)
</code></pre>
<p>As others have pointed out before, while this functionality <em>can be used</em> to accumulate, especially if we’re adding it to other blocks than <code>for</code>, it really is just a rebinding tool. So perhaps <code>rebind</code> is a better keyword?</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">i = 0

list = for element &lt;- [1, 2, 3] do
    element * i
  rebind
    i &lt;- i + 1
  end

list #=&gt; [0, 2, 6]
i #=&gt; 3 (or 2?)
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310150" data-batch-url="/posts/batch_likers">
                        8
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/local-accumulators-for-cleaner-comprehensions/60130/108">Post #107</a>
	                </div>
	            </div>
              <div id="likers-container-310150" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310150"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #107"></div>
  </section>
</div>
    <div class="postbit" id="310152" data-post-id="310152">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="christhekeele" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/120/1039_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  christhekeele
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Under this construct, the original <code>if</code> example would become:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">value = 123

if true do
  value = 456
rebind
  value &lt;- value
end

value #=&gt; 456
</code></pre>
<p>Not a verbosity or readability win, but a trivial case. With a more complicated conditional I can see resurfacing an intermediate value you don’t want to lose or return directly from the expression being useful.</p>
<hr>
<p>The problem you are trying to address becomes:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">section_counter = 0
lesson_counter = 0

for section &lt;- sections do
  if section["reset_lesson_position"] do
    lesson_counter = 0
  rebind
    lesson_counter &lt;- lesson_counter
  end

  section_counter = section_counter + 1

  lessons =
    for lesson &lt;- section["lessons"] do
      lesson_counter = lesson_counter + 1
      Map.put(lesson, "position", lesson_counter)
    rebind
      lesson_counter &lt;- lesson_counter
    end

  section
  |&gt; Map.put("lessons", lessons)
  |&gt; Map.put("position", section_counter)
rebind
  lesson_counter &lt;- lesson_counter
  section_counter &lt;- section_counter
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310152" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/local-accumulators-for-cleaner-comprehensions/60130/109">Post #108</a>
	                </div>
	            </div>
              <div id="likers-container-310152" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310152"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #108"></div>
  </section>
</div>
    <div class="postbit" id="310153" data-post-id="310153">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="christhekeele" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/120/1039_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  christhekeele
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="christhekeele" data-post="108" data-topic="60130">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/48/1039_2.png" class="avatar"> christhekeele:</div>
<blockquote>
<p><code>else</code>/<code>catch</code>/<code>rescue</code>/<code>finally</code></p>
</blockquote>
</aside>
<p>Additionally, there is precedence for these <code>do</code> extensions not being allowed on just any block; for <code>else</code> is only allowed in <code>if</code> and <code>with</code>; <code>catch</code> in <code>def</code> and <code>try</code>; so we could pick and chose which block constructs this makes sense for (<code>for</code> and <code>with</code> being the obvious candidates).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310153" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/local-accumulators-for-cleaner-comprehensions/60130/110">Post #109</a>
	                </div>
	            </div>
              <div id="likers-container-310153" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310153"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #109"></div>
  </section>
</div>
    <div class="postbit" id="310154" data-post-id="310154">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="VictorGaiva" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/VictorGaiva/120/34082_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  VictorGaiva
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>All the exemples that use a custom keyword to define a variable doesn’t really feels like the it is Elixir. But so far <code>mut</code> keyword felt the best, and we can declare and use Rust <code>mut</code> variables in a similar way, while temporaraly borrowring them to inner scopes.</p>
<p>But now I like this one the best. It feels like it fits very well with the current way Elixir looks and feels, while limiting the area of effect and introducing no additional keyword used to only to declare a variable.</p>
<p>But I feel like this solution might be too limiting, but also Elixir itself already have some similar limites that make a lot of sense.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310154" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/local-accumulators-for-cleaner-comprehensions/60130/111">Post #110</a>
	                </div>
	            </div>
              <div id="likers-container-310154" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310154"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #110"></div>
  </section>
</div>
    <div class="postbit" id="310155" data-post-id="310155">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="christhekeele" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/120/1039_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  christhekeele
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Notice the question in the comment: <code>i #=&gt; 3 (or 2?)</code></p>
<aside class="quote no-group" data-username="christhekeele" data-post="108" data-topic="60130">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/48/1039_2.png" class="avatar"> christhekeele:</div>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">i = 0

list = for element &lt;- [1, 2, 3] do
    element * i
  rebind
    i &lt;- i + 1
  end

list #=&gt; [0, 2, 6]
i #=&gt; 3 (or 2?)
</code></pre>
</blockquote>
</aside>
<p>It suggests two interesting questions about this implementation:</p>
<ol>
<li>Would the rebind run again after the final iteration?</li>
<li>Would <em><strong>not</strong> re-referencing <code>i</code></em> after the <code>for</code> issue a <code>unused variable</code> warning?</li>
</ol>
<p>The latter point seems compelling to me: if you’re not using the output rebinding, you probably shouldn’t be using the syntax at all! <code>for Enum.with_index</code>/<code>for reduce:</code> being a better alternative.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310155" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/local-accumulators-for-cleaner-comprehensions/60130/112">Post #111</a>
	                </div>
	            </div>
              <div id="likers-container-310155" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310155"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #111"></div>
  </section>
</div>
    <div class="postbit" id="310156" data-post-id="310156">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="christhekeele" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/120/1039_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  christhekeele
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="christhekeele" data-post="109" data-topic="60130">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/48/1039_2.png" class="avatar"> christhekeele:</div>
<blockquote>
<p>The problem you are trying to address becomes</p>
</blockquote>
</aside>
<p>More idiomatically, I’d want to rewrite this as</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">section_counter = 0
lesson_counter = 0

for section &lt;- sections do
  lesson_counter = if section["reset_lesson_position"], do: 0, else: lesson_counter

  lessons =
    for lesson &lt;- section["lessons"] do
      Map.put(lesson, "position", lesson_counter)
    rebind
      lesson_counter &lt;- lesson_counter + 1
    end

  section
  |&gt; Map.put("lessons", lessons)
  |&gt; Map.put("position", section_counter)
rebind
  lesson_counter &lt;- lesson_counter
  section_counter &lt;- section_counter + 1
end
</code></pre>
<p>But as this is effectively a do-while, it offsets the counts by 1 less. However we can’t initialize the starting values to <code>1</code> because then we’d appear to have counted 1 lesson if <code>sections</code> is empty. Not a perfectly elegant replacement, you’d have to do more special-casing before entering the loop.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310156" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/local-accumulators-for-cleaner-comprehensions/60130/113">Post #112</a>
	                </div>
	            </div>
              <div id="likers-container-310156" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310156"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #112"></div>
  </section>
</div>
    <div class="postbit" id="310157" data-post-id="310157">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sabiwara" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sabiwara/120/18612_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sabiwara
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Elixir Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The point about <code>catch</code> / <code>rescue</code> is a great one, seems like an implementation headache.</p>
<p>Accessing a local accumulator in these would need to be forbidden for this to work I suppose.</p>
<p>(Sorry just thinking aloud) Maybe a separate improvement to comprehensions could be a new <code>break</code> function which could be added and would allow the comprehension to bail. <code>break</code> could support these local accumulators and would allow things usually done with <code>Enum.find_value</code> &amp; co</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310157" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/local-accumulators-for-cleaner-comprehensions/60130/114">Post #113</a>
	                </div>
	            </div>
              <div id="likers-container-310157" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310157"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #113"></div>
  </section>
</div>
    <div class="postbit" id="310163" data-post-id="310163">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cmo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cmo/120/19618_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cmo
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve definitely wanted <code>break</code> for my <code>for</code> compressions to replicate <code>find</code> and <code>reduce_while</code>. I know <a class="mention" href="/u/hst337" rel="nofollow">@hst337</a> knows that no one uses <code>for</code> compressions, but I use them all the time.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="310163" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/local-accumulators-for-cleaner-comprehensions/60130/115">Post #114</a>
	                </div>
	            </div>
              <div id="likers-container-310163" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="310163"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #114"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/60130/load_more?page=12">Load more posts (135 remaining)</a>
</div></template></turbo-stream>