<div dir="ltr"><div style class="markdown-here-wrapper" id="markdown-here-wrapper-412496"><p style="margin:1.2em 0px!important">Not when we have <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">maybe</code> and <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">either</code> with those names already.</p>


</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 11, 2013 at 12:05 AM, Carter Schonwald <span dir="ltr">&lt;<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">just to add a bit of bikeshedding, wouldn&#39;t it better be called something like boolElim ?</div><div class="gmail_extra">

<br><br><div class="gmail_quote"><div><div class="h5">On Tue, Sep 10, 2013 at 6:02 PM, Oliver Charles <span dir="ltr">&lt;<a href="mailto:ollie@ocharles.org.uk" target="_blank">ollie@ocharles.org.uk</a>&gt;</span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Hello,<br>
<br>
I would like to propose that the following is added to Data.Bool in base:<br>
<br>
bool :: a -&gt; a -&gt; Bool -&gt; a<br>
bool f _ False = f<br>
bool _ t True  = t<br>
<br>
(Aka, bool f t b = if b then t else f)<br>
<br>
The purpose of this is hopefully evident from its definition. I find<br>
myself reaching for this in cases similar to where I would use &#39;maybe&#39; -<br>
often when I&#39;m working with &#39;fmap&#39; and don&#39;t want to start introducing<br>
names for the function I am using to map over some functor.<br>
<br>
I suggested this in #haskell and other people also seem frustrated this<br>
doesn&#39;t exist, and would like to see it happen - hopefully they will<br>
voice their support as a reply here.<br>
<br>
A quick search on FPComplete&#39;s Hoogle [1] shows five equivalent<br>
functions on the first page - and I&#39;m sure there are more on subsequent<br>
pages.<br>
<br>
Thoughts?<br>
- ocharles<br>
<br>
---<br>
[1]:<br>
<a href="https://www.fpcomplete.com/hoogle?q=Bool+-%3E+a+-%3E+a+-%3E+a&amp;env=ghc-7.4.2-stable-13.09" target="_blank">https://www.fpcomplete.com/hoogle?q=Bool+-%3E+a+-%3E+a+-%3E+a&amp;env=ghc-7.4.2-stable-13.09</a><br>
<br>
<br></div></div>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>