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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="zachallaun" data-post="154" data-topic="56827">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachallaun/48/29208_2.png" class="avatar"> zachallaun:</div>
<blockquote>
<p>I agree with many of the points you’ve made. One I’ll call out specifically: the compiler <em>should complain</em> for catch-all cases where the entire set of known values are already handled!</p>
</blockquote>
</aside>
<p>This is also tricky. Imagine that you are working with a library that returns <code>:foo or :bar</code> on version v0.1 and <code>:foo or :bar or :baz</code> on v0.2. You update to v0.2 and add the catch all because you don’t care about <code>:baz</code> but you still want to support earlier versions. Matching on <code>:baz</code> will warn that it is unreachable code on v0.1. If we complain that we handle all, then that’s an issue on v0.1 as well.</p>
<p>Now I am going back to thinking that <code>case!</code> maybe the best option, because it is a single char to get all the behaviour you get with let-it crash in <code>case</code> today.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="294666" 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/type-system-updates-moving-from-research-into-development/56827/156">Post #155</a>
	                </div>
	            </div>
              <div id="likers-container-294666" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="294666"
                     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 #155"></div>
  </section>
</div>
    <div class="postbit" id="294672" data-post-id="294672">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="adw632" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  adw632
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="zachallaun" data-post="154" data-topic="56827">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachallaun/48/29208_2.png" class="avatar"> zachallaun:</div>
<blockquote>
<p>I agree with many of the points you’ve made. One I’ll call out specifically: the compiler <em>should complain</em> for catch-all cases where the entire set of known values are already handled!</p>
</blockquote>
</aside>
<p>There are of course other checks, such as case patterns that can’t be matched in the range of possible values.</p>
<p>Again this can help detect typos in case patterns or where APIs change over time and we have stale code still using “ye Olde” return values from a prior API versions.</p>
<p>We can reason fairly strongly that catch-all patterns really are bad for code evolution and maintenance but are absolutely required in other languages that don’t have a <em>let it crash</em> runtime.  By hook or by crook in most languages you must be defensive and handle <strong>all</strong> the cases you <em>don’t know</em> about at design time which could <em>in theory</em> occur at run time. Obviously over time this makes it harder to detect where you should expressly handle new or changed return values.</p>
<p>We have a very distinct point of difference where many other langauges can’t detect code evolution problems as well as we potentially can, but to gain these defensive <em>design time</em> powers we have to resist overspecifying the matching patterns using catch-all cases and <strong>be as explicit as we can.</strong></p>
<p>In summary, just as Dijkstra wrote “Goto considered harmful”, we can probably say with some confidence in respect of the future Elixir type system:</p>
<p><strong>Catch-all patterns considered harmful</strong>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="294672" 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/type-system-updates-moving-from-research-into-development/56827/157">Post #156</a>
	                </div>
	            </div>
              <div id="likers-container-294672" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="294672"
                     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 #156"></div>
  </section>
</div>
    <div class="postbit" id="294679" data-post-id="294679">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="stevensonmt" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/stevensonmt/120/20503_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  stevensonmt
                  </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="145" data-topic="56827">
<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>pokemon clauses</p>
</blockquote>
</aside>
<p><img src="https://forum.elixirforum.com/images/emoji/apple/rofl.png?v=15" title=":rofl:" class="emoji only-emoji" alt=":rofl:" 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="294679" 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/type-system-updates-moving-from-research-into-development/56827/158">Post #157</a>
	                </div>
	            </div>
              <div id="likers-container-294679" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="294679"
                     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 #157"></div>
  </section>
</div>
    <div class="postbit" id="294686" data-post-id="294686">
  <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">
								<aside class="quote no-group" data-username="dimitarvp" data-post="148" data-topic="56827">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>Been reading the last replies carefully but I am starting to lose the thread of thought; I got no idea what the other posters (you included) have in mind for the theoretical <code>???</code> thingy exactly.</p>
</blockquote>
</aside>
<p>Same here, now I am getting confused <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"><br>
My understanding until now was that the pokemon clause <code>_ -&gt; ???</code> would be required to silence the compiler exhaustiveness warning, while willingly keeping the existing assertive behavior of <code>case</code>. The clause would have literally no effect on the compiled code and could be removed when we expand it, it would just signal intent. If we take the true/false example above:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  "true" -&gt; on(...)
  "false" -&gt; off(...)
  # can't prove the compiler these are the only values I'm getting,
  # but anything else is unexpected really
  _ -&gt; ??? 
</code></pre>
<p>But if we don’t allow catch all clauses, what would be the syntax to achieve this without getting a warning?</p>
<p>Also thinking (assuming we do have pkmn clauses after all): the compiler could detect unreachable and unnecessary pokemon clauses and warn about these too, which could prevent some abuses.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="294686" 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/type-system-updates-moving-from-research-into-development/56827/159">Post #158</a>
	                </div>
	            </div>
              <div id="likers-container-294686" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="294686"
                     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 #158"></div>
  </section>
</div>
    <div class="postbit" id="294691" data-post-id="294691">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-Elixir-Core-Team" data-username="sabiwara" data-post="159" data-topic="56827">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sabiwara/48/18612_2.png" class="avatar"> sabiwara:</div>
<blockquote>
<p>But if we don’t allow catch all clauses, what would be the syntax to achieve this without getting a warning?</p>
</blockquote>
</aside>
<p>I think that’s the <code>case</code>/<code>case!</code> syntax where you signal to the compiler that the case statement needs to be checked for exhaustiveness (exhaustivity?) with <code>case!</code> but not with <code>case</code> (so all legacy code just functions as is even in compilation).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="294691" 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/type-system-updates-moving-from-research-into-development/56827/160">Post #159</a>
	                </div>
	            </div>
              <div id="likers-container-294691" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="294691"
                     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 #159"></div>
  </section>
</div>
    <div class="postbit" id="294694" data-post-id="294694">
  <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>I understood this as an alternative to <code>case!</code> when proposed <a href="https://forum.elixirforum.com/t/type-system-updates-moving-from-research-into-development/56827/113" rel="nofollow">here</a>, but maybe they could/should be used in conjunction indeed.</p>
<p>I also wonder what to make of <code>=/2</code>.<br>
<code>{:ok, value} = foo()</code>, should it be considered intentionally assertive or warn if <code>foo</code> could also be returning an error tuple? I think the former makes sense, else it would be almost useless as a match operator (except maybe for structs).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="294694" 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/type-system-updates-moving-from-research-into-development/56827/161">Post #160</a>
	                </div>
	            </div>
              <div id="likers-container-294694" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="294694"
                     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 #160"></div>
  </section>
</div>
    <div class="postbit" id="294697" data-post-id="294697">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-Elixir-Core-Team" data-username="sabiwara" data-post="159" data-topic="56827">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sabiwara/48/18612_2.png" class="avatar"> sabiwara:</div>
<blockquote>
<p>My understanding until now was that the pokemon clause <code>_ -&gt; ???</code> would be required to silence the compiler exhaustiveness warning, while willingly keeping the existing assertive behavior of <code>case</code>.</p>
</blockquote>
</aside>
<p>The issue is that by adding <code>_ -&gt; ???</code> you are basically opting out of all future checks. Imagine you use <code>_ -&gt; ???</code> because the function returned <code>:baz</code> which you didn’t care. Now what happens if the function starts returning <code>:bat</code>? Were you meant to catch both?</p>
<p>So the argument is that <code>_ -&gt; ???</code> is making things strictly more verbose for no added benefit. If you want to better communicate, then using <code>:bar -&gt; ???</code> is better.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="294697" 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/type-system-updates-moving-from-research-into-development/56827/162">Post #161</a>
	                </div>
	            </div>
              <div id="likers-container-294697" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="294697"
                     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 #161"></div>
  </section>
</div>
    <div class="postbit" id="294701" data-post-id="294701">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I think a new phrase has been coined here, I will use it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="294701" 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/type-system-updates-moving-from-research-into-development/56827/163">Post #162</a>
	                </div>
	            </div>
              <div id="likers-container-294701" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="294701"
                     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 #162"></div>
  </section>
</div>
    <div class="postbit" id="294708" data-post-id="294708">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>To be fair, <a class="mention" href="/u/sabiwara" rel="nofollow">@sabiwara</a> <a href="https://forum.elixirforum.com/t/type-system-updates-moving-from-research-into-development/56827/53" rel="nofollow">already said in this thread</a> <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">  I remember because I quietly lol’d to myself at 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="294708" 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/type-system-updates-moving-from-research-into-development/56827/164">Post #163</a>
	                </div>
	            </div>
              <div id="likers-container-294708" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="294708"
                     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 #163"></div>
  </section>
</div>
    <div class="postbit" id="294715" data-post-id="294715">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </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="156" data-topic="56827">
<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>Now I am going back to thinking that <code>case!</code> maybe the best option, because it is a single char to get all the behaviour you get with let-it crash in <code>case</code> today.</p>
</blockquote>
</aside>
<p>Well <code>unreachable!</code> and <code>case!</code> are not mutually exclusive, they serve different needs. Stuff like <code>unreachable!</code> and the benefits you found in it can and should wait. The pluggable type checker should come first. Though it’s also true that, as you said, <code>unreachable!</code> could complement the type checker if implemented in concert with it (i.e. issue warnings for places should [not] be unreachable, which is valuable when trying to catch non-exhaustiveness bugs).</p>
<aside class="quote no-group" data-username="adw632" data-post="157" data-topic="56827">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p><strong>Catch-all patterns considered harmful</strong>.</p>
</blockquote>
</aside>
<p>Absolutely. I witnessed something very similar many years ago when people were very happliy doing <code>catch (Exception e) { ... }</code> in Java. And that achieved only one thing – it masked bugs. That made the code much harder to troubleshoot. We don’t need that in Elixir at runtime. We need something we can opt in to if we want to, and having (or lacking) stuff like <code>case!</code> should not be a compile-time error – so yeah, let’s not do overly defensive programming. We lose a core and very strong benefit of using a BEAM VM language.</p>
<aside class="quote group-Elixir-Core-Team" data-username="sabiwara" data-post="159" data-topic="56827">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sabiwara/48/18612_2.png" class="avatar"> sabiwara:</div>
<blockquote>
<p>My understanding until now was that the pokemon clause <code>_ -&gt; ???</code> would be required to silence the compiler exhaustiveness warning, while willingly keeping the existing assertive behavior of <code>case</code>.</p>
</blockquote>
</aside>
<p>Well if the new type checker can be instructed to exempt certain classes of warnings or just particular locations as Credo does, then that pokemon clause becomes completely unnecessary. You’ll get exactly the same behavior if you never write it + opt out of the exhaustiveness check on this one place where you don’t want to deal with it.</p>
<p>…Unless I keep misunderstanding the ever-expanding scope of this discussion <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>
<aside class="quote no-group" data-username="stevensonmt" data-post="160" data-topic="56827">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/stevensonmt/48/20503_2.png" class="avatar"> stevensonmt:</div>
<blockquote>
<p>I think that’s the <code>case</code>/<code>case!</code> syntax where you signal to the compiler that the case statement needs to be checked for exhaustiveness (exhaustivity?) with <code>case!</code> but not with <code>case</code> (so all legacy code just functions as is even in compilation).</p>
</blockquote>
</aside>
<p>EXACTLY. I believe you are the one who best summarized it so far, thank you!</p>
<aside class="quote group-Elixir-Core-Team" data-username="sabiwara" data-post="161" data-topic="56827">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sabiwara/48/18612_2.png" class="avatar"> sabiwara:</div>
<blockquote>
<p><code>{:ok, value} = foo()</code>, should it be considered intentionally assertive or warn if <code>foo</code> could also be returning an error tuple?</p>
</blockquote>
</aside>
<p>IMO it should retain the current runtime behavior <em>but</em> issue a warning when ran against the new type checker. It should still compile and run as before and blow up if anything other except an <code>:ok</code> tuple is returned.</p>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="162" data-topic="56827">
<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>So the argument is that <code>_ -&gt; ???</code> is making things strictly more verbose for no added benefit. If you want to better communicate, then using <code>:bar -&gt; ???</code> is better.</p>
</blockquote>
</aside>
<p>EXACTLY x2. IMO the goal is to try and introduce exhaustiveness check warnings for whoever wants to opt in to them and leave everything else the same for (a) those who will use Dialyzer and not the new type checker and (b) at runtime.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="294715" data-batch-url="/posts/batch_likers">
                        3
                      </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/type-system-updates-moving-from-research-into-development/56827/165">Post #164</a>
	                </div>
	            </div>
              <div id="likers-container-294715" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="294715"
                     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 #164"></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/56827/load_more?page=17">Load more posts (4 remaining)</a>
</div></template></turbo-stream>