<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Types where it makes sense, or types for which such semantics would be a good idea? Because, for example, you <i class="">could</i> do something like this:<div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> HTMLParser : </span><span style="font-variant-ligatures: no-common-ligatures" class="">IntegerLiteralConvertible</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(integerLiteral value: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">IntegerLiteralType</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <font color="#4f8187" class="">htmlMajorVersion</font></span><span style="color: rgb(0, 0, 0); font-variant-ligatures: no-common-ligatures;" class=""> = value</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> htmlMinorVersion</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div class=""><br class=""></div><div class="">Back in the realm of math, I don’t think Sedenions — a 16-demensional (in the sense that complex numbers are 2-dimensional) number — have a well-defined division operator.</div><div class=""><br class=""></div><div class="">As a more likely example, I don’t think it’d be too much of a stretch to attach integer literal semantics to matrices:</div><div class=""><div style="margin: 0px; line-height: normal;" class=""><div style="font-family: Menlo; margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> x: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Matrix</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// Sets diagonal to 1</span></div><div class="">Matrices don’t have a division operator, and you can’t do <i class="">any</i> of the `Arithmetic` functions to two matrices without first checking their dimensions. Plus, inherently-dimensioned matrix types:</div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> x = </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Matrix</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">_2</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">,</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">_3</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">>() </span><span style="font-variant-ligatures: no-common-ligatures" class="">// "_2" and "_3" are dummy types</span></div></div></div></div><div class=""><i class="">can’t</i> implement `*`, unless their two dimensions happen to be equal — "<span style="font-family: Menlo; color: rgb(112, 61, 170); font-variant-ligatures: no-common-ligatures;" class="">Matrix</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class=""><</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class=""><font color="#272ad8" class="">2</font></span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class=""><font color="#272ad8" class="">3</font></span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">>() * </span><span style="font-family: Menlo; color: rgb(112, 61, 170); font-variant-ligatures: no-common-ligatures;" class="">Matrix</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class=""><</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class=""><font color="#272ad8" class="">2</font></span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class=""><font color="#272ad8" class="">3</font></span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">>()</span>” doesn’t have a valid definition.</div><div class=""><br class=""></div></div></div><div class="">- Dave Sweeris</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">On Jun 29, 2016, at 7:49 AM, Steve Canon via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">Semi-serious question for integer literals in particular: do we need a separate protocol at all? Are there types we want to support where integer literals should be supported, but + doesn't make sense? Where 1+1 actually isn't 2?<br class=""><br class="">If not, are integer literals really just part of Arithmetic?<br class=""><br class="">- Steve<br class=""></blockquote><br class=""></div></div></body></html>