title: How to match on non-existing key of map in function head
body: <p>I have a function that maintains some values as state for its recursion and in order to be flexible with the order of its arguments, I am using a <code>Map</code> to store the state and pass it around between calls.</p>
  
  <p>My base case is that the function gets called without a <code>socket</code>, so there should be a case where only that setup is done. However, I can't find a way to match a non-existing key of a <code>Map</code>.</p>
  
  <p>Attempts:
  </p>
  
  <pre><code>def measure(args = %{socket: nil}) ...
  
  def measure(args = %{socket: socket}) when not is_port(socket) ...
  </code></pre>
  
  <p>However, these patterns only match when there <strong>exists</strong> a key <code>socket</code> that is <code>nil</code>/not a port.</p>
  
  <p>Is there a way of specifying a pattern that does match a non-existing key? Or do I have to create another <em>entry</em> function that provides default values for my Map?</p>