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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/sasajuric" rel="nofollow">@sasajuric</a>,</p>
<p>I often find myself having to “tag” my with clauses, often because checking <code>{:ok, _}|{:error, _}</code> isn’t descriptive enough for error handling,</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">with {:post, {:ok, post}} &lt;- {:post, fetch_post(id)},
     {:meta, {:ok, meta}} &lt;- {:other_data, fetch_post_meta(post)},
     {:auth, :ok} &lt;- {:auth, authorize(...)},
     do: ...
else
  {:post, {:error, reason}} -&gt; show_404_or_whatever()
  {:meta, {:error, reason}} -&gt; show_post_but_flag_error_or_something()
  {:auth, :unauthorized} -&gt; redirect_to_login()
end
</code></pre>
<p>vs</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">with {:ok, post}} &lt;- fetch_post(id),
     {:ok, meta}} &lt;- fetch_post_meta(post),
     :ok &lt;- authorize(...),
     do: ...
else
  # cant tell here if {:error, reason} is for fetch_post or fetch_post_meta
  {:error, reason} -&gt; generic_error(reason) #?
  :unauthorized -&gt; redirect_to_login()
end
</code></pre>
<p>Is this pattern implied in your posts or do you have another solution? Always match on specific <code>reason</code> values? Maybe you simply structure the rest of the app so it isn’t needed (ie: the call should pass in <code>meta</code> before we even get to the with or ?).</p>
<p>I don’t find tagging to be that bad, but it does add some noise and it can feel like if you have to tag any, you should tag them all, so even stuff like <code>:ok|:unauthorized</code> end up getting tagged.</p>
<p>Great posts.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="207604" 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/elixir-blog-posts/150/692">Post #691</a>
	                </div>
	            </div>
              <div id="likers-container-207604" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="207604"
                     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 #691"></div>
  </section>
</div>
    <div class="postbit" id="207608" data-post-id="207608">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Great question!</p>
<p>I mostly try to avoid tagging in <code>with</code>, because I feel it makes the code harder to understand. At VBT projects we use a <a href="https://github.com/rrrene/credo/blob/master/lib/credo/check/readability/with_custom_tagged_tuple.ex" rel="noopener nofollow ugc">credo check</a> to prevent this pattern. Before I started working with them, the team was using this pattern extensively, and no one really misses it now <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>In this particular example, I’d make the core function return something like <code>{:ok, post_with_meta} | {:error, :not_found | {:no_meta, post} | :unauthorized}</code>, which I think clearly communicates what can go wrong with a business operation.</p>
<p>The client such as controller or absinthe resolver can now do something like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">case Core.fetch_post(...) do
  {:ok, post_with_meta} -&gt; ...
  {:error, :not_found} -&gt; ...
  ...
end
</code></pre>
<p>We mostly work with graphql, and we use some company-wide absinthe middleware that automatically handle common errors, such as unauthorized or <code>Ecto.Changeset.t</code>, which keeps the resolver code small and focused.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="207608" data-batch-url="/posts/batch_likers">
                        7
                      </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/elixir-blog-posts/150/693">Post #692</a>
	                </div>
	            </div>
              <div id="likers-container-207608" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="207608"
                     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 #692"></div>
  </section>
</div>
    <div class="postbit" id="207758" data-post-id="207758">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m doing live coding using Elixir programming language, explaining basic functional programming abstractions like parametric and ad-hoc generics (polymorphism), functors, functional composition, currying and lazy evaluation.</p>
<div class="youtube-onebox lazy-video-container" data-video-id="pl_uwcRSfJI" data-video-title="TLP1 Functional Programming and Functors in Elixir" data-video-start-time="" data-provider-name="youtube">
  <a href="https://www.youtube.com/watch?v=pl_uwcRSfJI" target="_blank" class="video-thumbnail" rel="noopener nofollow ugc">
    <img class="youtube-thumbnail" src="https://i.ytimg.com/vi/pl_uwcRSfJI/hqdefault.jpg" title="TLP1 Functional Programming and Functors in Elixir" width="480" height="360">
  </a>
</div>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="207758" 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/elixir-blog-posts/150/694">Post #693</a>
	                </div>
	            </div>
              <div id="likers-container-207758" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="207758"
                     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 #693"></div>
  </section>
</div>
    <div class="postbit" id="207939" data-post-id="207939">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="seanmor5" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/seanmor5/120/20610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  seanmor5
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Genetic Algorithms in Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a href="https://seanmoriarity.com/2021/03/25/nx-tip-of-the-week-6-compiler-or-backend/" rel="noopener nofollow ugc">Nx Tip of the Week #6 - Compiler or Backend?</a></p>
<p>I hope this post is helpful <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="207939" data-batch-url="/posts/batch_likers">
                        4
                      </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/elixir-blog-posts/150/695">Post #694</a>
	                </div>
	            </div>
              <div id="likers-container-207939" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="207939"
                     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 #694"></div>
  </section>
</div>
    <div class="postbit" id="209668" data-post-id="209668">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a href="https://medium.com/very-big-things/towards-maintainable-elixir-testing-b32ac0604b99" class="onebox" target="_blank" rel="noopener nofollow ugc">https://medium.com/very-big-things/towards-maintainable-elixir-testing-b32ac0604b99</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="209668" data-batch-url="/posts/batch_likers">
                        6
                      </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/elixir-blog-posts/150/696">Post #695</a>
	                </div>
	            </div>
              <div id="likers-container-209668" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="209668"
                     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 #695"></div>
  </section>
</div>
    <div class="postbit" id="209672" data-post-id="209672">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you got this series. Not sure if it’s a lot of work, but I would have found it helpful if the article series had an index of the articles (or was a doubly linked list, lol). When I finished the first, I wanted to immediately go to the second and so on.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="209672" 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/elixir-blog-posts/150/697">Post #696</a>
	                </div>
	            </div>
              <div id="likers-container-209672" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="209672"
                     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 #696"></div>
  </section>
</div>
    <div class="postbit" id="209731" data-post-id="209731">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Even medium has RSS, and the RSS contains full text.<br>
just subscribe <a href="https://medium.com/feed/very-big-things" rel="noopener nofollow ugc">https://medium.com/feed/very-big-things</a> in your favorite feed reader.</p>
<p>If you don’t have a favorate feed reader, you can use this link:<br>
<a href="https://airss.roastidio.us/?url=https://medium.com/very-big-things" rel="noopener nofollow ugc">https://airss.roastidio.us/?url=https://medium.com/very-big-things</a></p>
<p>The above link use <a href="https://github.com/derek-zhou/airss#caveat" class="inline-onebox" rel="noopener nofollow ugc">GitHub - derek-zhou/airss: A light weight feed reader that runs in your browser, with no backend · GitHub</a> that come with some caveats though. You may want to read it first.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="209731" 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/elixir-blog-posts/150/699">Post #698</a>
	                </div>
	            </div>
              <div id="likers-container-209731" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="209731"
                     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 #698"></div>
  </section>
</div>
    <div class="postbit" id="210316" data-post-id="210316">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve just published a piece on PostgreSQL EXPLAIN ANALYZE. It’s not strictly about Elixir but since PG is popular with Phoenix apps I though I’d share it here:</p>
<p><a href="https://pawelurbanek.com/explain-analyze-indexes" class="onebox" target="_blank" rel="noopener nofollow ugc">https://pawelurbanek.com/explain-analyze-indexes</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="210316" 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/elixir-blog-posts/150/700">Post #699</a>
	                </div>
	            </div>
              <div id="likers-container-210316" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="210316"
                     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 #699"></div>
  </section>
</div>
    <div class="postbit" id="210349" data-post-id="210349">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="PJUllrich" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/PJUllrich/120/15944_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  PJUllrich
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Building Table Views with Phoenix LiveView</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>How to deploy a simply Phoenix LiveView + Ecto app to <a href="http://fly.io" rel="noopener nofollow ugc">fly.io</a></p>
<p><a href="https://www.peterullrich.com/deploy-phoenix-with-flyio" class="onebox" target="_blank" rel="noopener nofollow ugc">https://www.peterullrich.com/deploy-phoenix-with-flyio</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="210349" data-batch-url="/posts/batch_likers">
                        4
                      </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/elixir-blog-posts/150/701">Post #700</a>
	                </div>
	            </div>
              <div id="likers-container-210349" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="210349"
                     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 #700"></div>
  </section>
</div>
    <div class="postbit" id="210402" data-post-id="210402">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><strong>How to compose and refactor Ecto queries with Queries Modules</strong></p>
<p><a href="https://curiosum.dev/blog/composable-elixir-ecto-queries-modules" class="onebox" target="_blank" rel="noopener nofollow ugc">https://curiosum.dev/blog/composable-elixir-ecto-queries-modules</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="210402" data-batch-url="/posts/batch_likers">
                        4
                      </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/elixir-blog-posts/150/702">Post #701</a>
	                </div>
	            </div>
              <div id="likers-container-210402" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="210402"
                     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 #701"></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/150/load_more?page=66">Load more posts (571 remaining)</a>
</div></template></turbo-stream>