<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Wrapper structs FTW. I think it's a lovely pattern that's super Swifty and really should be advertised more for solving these kinds of problems. Language-level features could also be useful for making that more usable, and the discussion about "strong" typealiases seems oriented in that direction.<br class=""><div><font color="#5856d6" class=""><br class=""><br class=""></font>Elviro<br class=""><font color="#5856d6" class=""><br class=""><br class=""></font><blockquote type="cite" class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class="">Il giorno 03 ago 2017, alle ore 08:35, David Hart via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; ha scritto:<br class=""><blockquote type="cite" class=""></blockquote><font color="#00afcd" class=""><br class=""><br class=""></font><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">On 3 Aug 2017, at 08:00, Slava Pestov &lt;<a href="mailto:spestov@apple.com" class="">spestov@apple.com</a>&gt; wrote:<br class=""><blockquote type="cite" class=""></blockquote><font color="#12c00e" class=""><br class=""><br class=""><br class=""></font><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">On Aug 2, 2017, at 10:48 PM, David Hart &lt;<a href="mailto:david@hartbit.com" class="">david@hartbit.com</a>&gt; wrote:<br class=""><blockquote type="cite" class=""></blockquote><br class=""><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Somewhat related: I have a similar problem in a project where I need two different Codable conformances for a type: one for coding/decoding from/to JSON, and another one for coding/decoding from/to a database row. The keys and formatting are not identical. The only solution around that for now is separate types, which can be sub-optimal from a performance point of view.</span></div></div></div></div></blockquote>Actually if the wrapper types are structs with a single field, their use should not introduce any additional overhead at runtime.<br class=""></div></div></div></blockquote><font color="#00afcd" class=""><br class=""></font>I ❤️ Swift<br class=""><font color="#00afcd" class=""><br class=""><br class=""></font>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Slava</div></div></div></div></div></div></blockquote></div></div></div></div></blockquote></div><br class=""></body></html>