<div dir="ltr">I'm pretty strongly -1 on adding (?). It is one of the few single character operators available to the average user out of the box and this is a space where we already have established combinators. It is a valuable portion of the namespace to spend and each approach we offer means more inessential complexity to newcomers to the language.<div><br></div><div>Given the existence of bool today I'm weakly -1 on ifThenElse. That said, if we were to add RebindableSyntax support for it, I think that I'd personally flip around to being in favor. It is a much more clear thing for RebindableSyntax to call out to than something called "bool" that comes with a different argument order.</div><div><br></div><div>These are just my personal feelings on the matter, and not any sort of "cast in stone" CLC judgments.</div><div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 16, 2016 at 9:43 PM, winter <span dir="ltr"><<a href="mailto:drkoster@qq.com" target="_blank">drkoster@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div dir="ltr" class="m_-336750182961869513mw-geshi m_-336750182961869513mw-content-ltr"><div class="m_-336750182961869513haskell m_-336750182961869513source-haskell"><pre class="m_-336750182961869513de1">It seems this’s a very old request, see <a href="https://wiki.haskell.org/If-then-else" target="_blank">https://wiki.haskell.org/If-<wbr>then-else</a>. I’d like to see following:</pre><pre class="m_-336750182961869513de1"><br></pre><pre class="m_-336750182961869513de1"><span class="m_-336750182961869513st0">ifThenElse :: Bool -> a -> a -> a
ifThenElse</span> True  x <span class="m_-336750182961869513sy0">_</span> <span class="m_-336750182961869513sy0">=</span> x
<span class="m_-336750182961869513st0">ifThenElse False _ y = y</span></pre></div></div><div><br></div><div><div dir="ltr" class="m_-336750182961869513mw-geshi m_-336750182961869513mw-content-ltr"><div class="m_-336750182961869513haskell m_-336750182961869513source-haskell"><pre class="m_-336750182961869513de1"><span class="m_-336750182961869513kw1">infixr</span> <span class="m_-336750182961869513nu0">1</span> <span class="m_-336750182961869513sy0">?</span>
<span class="m_-336750182961869513br0">(</span><span class="m_-336750182961869513sy0">?</span><span class="m_-336750182961869513br0">)</span> <span class="m_-336750182961869513sy0">::</span> <span class="m_-336750182961869513kw4">Bool</span> <span class="m_-336750182961869513sy0">-></span> a <span class="m_-336750182961869513sy0">-></span> a <span class="m_-336750182961869513sy0">-></span> a
<span class="m_-336750182961869513br0">(</span><span class="m_-336750182961869513sy0">?</span><span class="m_-336750182961869513br0">)</span> <span class="m_-336750182961869513sy0">=</span> ifThenElse</pre><div><br></div></div></div><div><pre class="m_-336750182961869513de1"><span class="m_-336750182961869513kw1">in Date.Bool module, it will have advantages that:</span></pre><pre class="m_-336750182961869513de1"><span class="m_-336750182961869513kw1"><br></span></pre><pre class="m_-336750182961869513de1"><span class="m_-336750182961869513kw1">+ It’s more composable than syntax.  </span></pre><pre class="m_-336750182961869513de1"><span class="m_-336750182961869513kw1">+ Write (xxx ? yyy $ zzz) instead of (if xxx then yyy else zzz) is more consistent with (f . g $ x) style, and save key strokes.</span></pre><pre class="m_-336750182961869513de1"><span class="m_-336750182961869513kw1">+ In module with RebindableSyntax enabled, you can import </span>ifThenElse to get default behavior.</pre><pre class="m_-336750182961869513de1"><br></pre><pre class="m_-336750182961869513de1">Whether or not to be exported by Prelude is another question, but Data.Bool seems a good place to start with.</pre><pre class="m_-336750182961869513de1"><br></pre><pre class="m_-336750182961869513de1">Cheers~</pre><span class="HOEnZb"><font color="#888888"><pre class="m_-336750182961869513de1">Winter</pre></font></span></div></div></div><br>______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>