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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Pins always operate by value. Pinning a value does not turn the value into a pattern.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66718" 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/how-can-you-assert-that-a-map-in-a-variable-matches-another-map-that-is-a-superset/11785/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-66718" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66718"
                     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 #11"></div>
  </section>
</div>
    <div class="postbit" id="66719" data-post-id="66719">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="axelson" data-post="9" data-topic="11785" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/48/26351_2.png" class="avatar"> axelson:</div>
<blockquote>
<p>Thanks! It looks like using MapSet.subset?/2 is my best option</p>
</blockquote>
</aside>
<p>My gut pick is this one:</p>
<pre><code>subset? =
  fn (map1, map2) -&gt;
    in_other =
      fn {key, value} -&gt;
        {:ok, value} == Map.fetch(map2, key)
      end
    map1
    |&gt; Map.to_list()
    |&gt; Enum.all?(in_other)
  end
</code></pre>
<p>as it simply verifies that all the necessary key/value pairs are present <em>and will stop as soon as that is <strong>not</strong> the case</em>.</p>
<p>In this case I also prefer to use <a href="https://hexdocs.pm/elixir/Map.html#fetch/2" rel="noopener nofollow ugc"><code>fetch/2</code></a> in order the leverage the underlying <a href="https://github.com/elixir-lang/elixir/blob/v1.6.0/lib/elixir/lib/map.ex#L237" rel="noopener nofollow ugc">map functionality</a> rather than relying on <a href="https://hexdocs.pm/elixir/Kernel.html#in/2" rel="noopener nofollow ugc"><code>in/2</code></a>’s macro <a href="https://github.com/elixir-lang/elixir/blob/v1.6.0/lib/elixir/lib/kernel.ex#L3255-L3304" rel="noopener nofollow ugc">magic</a> even if it makes the code a bit more verbose (so be it).</p>
<p>One thing to be aware of is that the empty set is a subset of any other set - the same is true for empty maps.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66719" 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/how-can-you-assert-that-a-map-in-a-variable-matches-another-map-that-is-a-superset/11785/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-66719" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66719"
                     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 #12"></div>
  </section>
</div>
    <div class="postbit" id="66722" data-post-id="66722">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="kelvinst" data-post="11" data-topic="11785">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kelvinst/48/10173_2.png" class="avatar"> kelvinst:</div>
<blockquote>
<p>Is there a specific reason for it?</p>
</blockquote>
</aside>
<p><a href="http://erlang.org/doc/reference_manual/patterns.html" class="inline-onebox" rel="nofollow">Pattern Matching — Erlang System Documentation v29.0.2</a></p>
<blockquote>
<p>In a pattern matching, a left-hand side <code>pattern</code> is matched against a right-hand side <code>term</code>.</p>
</blockquote>
<p>The phrasing suggests to me that <code>patterns</code> are <em>very different</em> from <code>term</code>s - patterns aren’t listed under <a href="http://erlang.org/doc/reference_manual/data_types.html#id66389" rel="nofollow">Data Types</a>.</p>
<p>Pinning ‘pins’ the <em>binding</em> - it expresses that no <em>re</em>-binding of that name should take place; at that point matching succeeds if both values are equal <em>otherwise</em> there will be a <code>:badmatch</code> error.</p>
<p>Erlang doesn’t need pinning because it doesn’t allow re-binding. But a simple name to the left of the match operator (<code>=</code>) means:</p>
<ul>
<li>if the name is unbound, bind the name to the right hand side (and return the bound/matched value)</li>
<li>if the name is bound and the name is bound to a value equal to the right hand side, succeed (and return the matched value)</li>
<li>if the name is bound and the name is bound to a value <strong>not</strong> equal to the right hand side, fail (and throw a <code>badmatch</code> error)</li>
</ul>
<p>FYI: Map is an Enumerable so <code>Enum.all?(map1, &amp;(&amp;1 in map2))</code> should work - I just like to be explicit.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66722" 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/how-can-you-assert-that-a-map-in-a-variable-matches-another-map-that-is-a-superset/11785/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-66722" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66722"
                     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 #13"></div>
  </section>
</div>
    <div class="postbit" id="66726" data-post-id="66726">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I see. Maybe the variable rebinding ability makes this a little confusing behaviour in Elixir.</p>
<aside class="quote no-group" data-username="peerreynders" data-post="14" data-topic="11785">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>FYI: Map is an Enumerable so Enum.all?(map1, &amp;(&amp;1 in map2)) should work - I just like to be explicit.</p>
</blockquote>
</aside>
<p>You’re right, and I’ve noticed that you’re very explicit. That’s good, even more in examples, but I just wanted to show him he can write it in a shorter way. <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> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66726" 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/how-can-you-assert-that-a-map-in-a-variable-matches-another-map-that-is-a-superset/11785/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-66726" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66726"
                     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 #14"></div>
  </section>
</div>
    <div class="postbit" id="66729" data-post-id="66729">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="axelson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/120/26351_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  axelson
                    <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>Scenic Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="peerreynders" data-post="13" data-topic="11785">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>My gut pick is this one:</p>
<p>subset? =<br>
fn (map1, map2) -&gt;<br>
in_other =<br>
fn {key, value} -&gt;<br>
{:ok, value} == Map.fetch(map2, key)<br>
end<br>
map1<br>
|&gt; Map.to_list()<br>
|&gt; Enum.all?(in_other)<br>
end</p>
</blockquote>
</aside>
<p><a class="mention" href="/u/peerreynders" rel="nofollow">@peerreynders</a> Do you like that version mainly for performance over the simpler:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">MapSet.subset?(MapSet.new(map1), MapSet.new(map2))
</code></pre>
<p>I wonder if there’s a way to convert a map to a pattern. Conceptually it seems possible.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66729" 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/how-can-you-assert-that-a-map-in-a-variable-matches-another-map-that-is-a-superset/11785/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-66729" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66729"
                     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 #15"></div>
  </section>
</div>
    <div class="postbit" id="66731" data-post-id="66731">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="axelson" data-post="16" data-topic="11785">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/48/26351_2.png" class="avatar"> axelson:</div>
<blockquote>
<p>over the simpler:</p>
</blockquote>
</aside>
<p>Either would be hidden behind a function so concise/simple/explicit/verbose really doesn’t factor into it. I would hope that the <code>fetch</code> solution is pretty good performance/memory wise - but that could be totally wrong - one would have to benchmark the various solutions in a representative environment to actually <em>know</em>.</p>
<blockquote>
<p>Conceptually it seems possible.</p>
</blockquote>
<p>At this point I doubt it. I can’t find a source but (at least for me) everything seems to hint that patterns are fixed at compile time - so short of writing a module with the injected pattern and compiling and then loading it…</p>
<p>It may have been one of those tradeoffs that allowed the BEAM to heavily optimize pattern matching - but I’m just guessing.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66731" 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/how-can-you-assert-that-a-map-in-a-variable-matches-another-map-that-is-a-superset/11785/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-66731" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66731"
                     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 #16"></div>
  </section>
</div>
    <div class="postbit" id="66752" data-post-id="66752">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="axelson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/120/26351_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  axelson
                    <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>Scenic Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="peerreynders" data-post="17" data-topic="11785">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>At this point I doubt it. I can’t find a source but (at least for me) everything seems to hint that patterns are fixed at compile time - so short of writing a module with the injected pattern and compiling and then loading it…</p>
<p>It may have been one of those tradeoffs that allowed the BEAM to heavily optimize pattern matching - but I’m just guessing.</p>
</blockquote>
</aside>
<p>Yeah it would make sense if a pattern is a compile-time construct in which case there would be no good way to use pattern matching for my problem as stated. Although for my current problem I am creating my map statically at compile time so I may be able to send my map to a macro and use that macro to pattern match against a map.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66752" 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/how-can-you-assert-that-a-map-in-a-variable-matches-another-map-that-is-a-superset/11785/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-66752" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66752"
                     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 #17"></div>
  </section>
</div>
    <div class="postbit" id="66759" data-post-id="66759">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Crudely (… must be one of the simplest applications for macros I’ve come across):</p>
<pre data-code-wrap="Elixir"><code class="lang-Elixir">defmodule Pattern do
  defmacro from(pattern) do
    quote do
      unquote(pattern)
    end
  end
end

defmodule Demo do
  require Pattern
  @demo_map %{a: 1}

  def subset?(super_map) do
    case super_map do
      Pattern.from(@demo_map) -&gt;
        true
      _ -&gt;
        false
    end
  end

  def subset2?(super_map) do
    try do
      Pattern.from(@demo_map) = super_map
      true
    catch
      :error, {:badmatch, _} -&gt;
        false
    end
  end

  def subset3?(Pattern.from(@demo_map) = _super_map), do: true
  def subset3?(_), do: false

  def a,
    do: @demo_map

  def with_fun(subset) do
    fn {k,v} -&gt;
      IO.puts("a ⊆ #{Atom.to_string(k)}: #{subset.(v)}")
    end
  end

  def with_fun({title, list}, fun) do
    IO.puts(title)
    Enum.each(list, with_fun(fun))
  end
end

check_list = [a: Demo.a, b: %{a: 1, b: 2}, c: %{c: 3}, e: %{}]

Demo.with_fun({"--- subset? ", check_list}, &amp;Demo.subset?/1)
Demo.with_fun({"--- subset2? ", check_list}, &amp;Demo.subset2?/1)
Demo.with_fun({"--- subset3? ", check_list}, &amp;Demo.subset3?/1)
</code></pre>
<pre data-code-wrap="bash"><code class="lang-bash">$ elixir demo5.exs
--- subset? 
a ⊆ a: true
a ⊆ b: true
a ⊆ c: false
a ⊆ e: false
--- subset2? 
a ⊆ a: true
a ⊆ b: true
a ⊆ c: false
a ⊆ e: false
--- subset3? 
a ⊆ a: true
a ⊆ b: true
a ⊆ c: false
a ⊆ e: false
</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="66759" 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/how-can-you-assert-that-a-map-in-a-variable-matches-another-map-that-is-a-superset/11785/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-66759" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66759"
                     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 #18"></div>
  </section>
</div>
    <div class="postbit" id="66760" data-post-id="66760">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><code>@demo_map</code> is replaced literally with <code>%{a: 1}</code> <strong>before</strong> the macro is called.</p>
<p>In theory it should be possible to use <code>@demo_map</code> directly at the exact same places where you currently use the macro.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66760" 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/how-can-you-assert-that-a-map-in-a-variable-matches-another-map-that-is-a-superset/11785/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-66760" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66760"
                     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 #19"></div>
  </section>
</div>
    <div class="postbit" id="66762" data-post-id="66762">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="NobbZ" data-post="20" data-topic="11785">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/48/27235_2.png" class="avatar"> NobbZ:</div>
<blockquote>
<p><code>@demo_map</code> is replaced literally with <code>%{a: 1}</code> before the macro is called.</p>
</blockquote>
</aside>
<p>Okay, my fault, it is passed in as <code>@demo_map</code>, comes out as <code>@demo_map</code> and then gets expanded to <code>%{a: 1}</code>, still, your macros shouldn’t be necessary…</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66762" 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/how-can-you-assert-that-a-map-in-a-variable-matches-another-map-that-is-a-superset/11785/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-66762" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66762"
                     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 #20"></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/11785/load_more?page=3">Load more posts (2 remaining)</a>
</div></template></turbo-stream>