p, and serializes it as a struct, choosing the type of the value based on the tag.</p>
<pre><code class="language-clojure">(defmethod mem/deserialize-from ::tagged-union
  [segment [_tagged-union tags type-map]]
  (let [tag (mem/deserialize-from segment ::mem/long)]
    [(nth tags tag)
     (mem/deserialize-from
      (mem/slice segment (mem/size-of ::mem/long))
      (get type-map tag))]))
</code></pre>
<p>Deserialization is a little more complex. First the tag is retrieved from the beginning of the segmen