A few words on Ruby's type annotations state
As a huge proponent of Ruby&#x27;s new pattern matching syntax (it has changed the way I write Ruby), I really, <i>really</i> like the idea of defp. So many times I wish I could overload a method, dispatching by pattern. Instead, I have to pattern match in the method body, which causes the method definition to become convoluted:<p><pre><code>    def for_environment(environment)
      environment =
        case environment
        in String =&gt; code unless code in UUID_RE
          return none # no support for filtering via environment codes
        in UUID_RE =&gt; id
          return none unless env = Environment.find_by(id:)

          env
        in Environment =&gt; env
          env
        in nil
          nil
        end
      
      ...
    end
</code></pre>
I think defp looks and <i>feels</i> very Ruby-like compared to the alternatives (which have the problems you discussed).<p>And Elixir is great, so I can appreciate the inspiration.