<div dir="ltr">It's not a completely different thing, it's the very same thing, but more general.</div><div class="gmail_extra"><br clear="all"><div>-- Dan Burton</div>
<br><br><div class="gmail_quote">On Sat, Oct 12, 2013 at 12:41 PM, Nikita Volkov <span dir="ltr"><<a href="mailto:nikita.y.volkov@gmail.com" target="_blank">nikita.y.volkov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">John Lato, you're offering a completely different thing and I would totally vote against it. Please don't flood.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">

2013/10/12 John Lato <span dir="ltr"><<a href="mailto:jwlato@gmail.com" target="_blank">jwlato@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>I'd prefer it if we had an operator in Control.Applicative such as<br><br></div><div>


  |> :: Alternative f => f a -> a -> f a<br></div><div>  l |> r = l <|> pure r<br>
<br></div><div>if it doesn't already exist, this would generalize fromMaybe, and complicated cases could be written as<br><br></div><div>  maybeA <|> maybeB |> c<br><br></div><div>but even this could be easily written using <|> and pure, so I'm not sure it pulls its weight.<br>



<br>John L.<br></div><div><br></div></div></div><div><br><div><div><div class="gmail_extra"><div class="gmail_quote"><div><div>On Sat, Oct 12, 2013 at 7:40 AM, Nikita Volkov <span dir="ltr"><<a href="mailto:nikita.y.volkov@gmail.com" target="_blank">nikita.y.volkov@gmail.com</a>></span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr"><div>I suggest to include this operator in "Data.Maybe" and "Prelude".<br>



</div><div><br></div><div><b>Implementation:</b></div><div><br></div><div>    (?:) :: Maybe a -> a -> a</div>
<div>    maybeA ?: b = fromMaybe b maybeA</div><div><br></div><div><b>Use cases:</b></div><div><br></div><div>    1.</div><div>        maybeValue ?: error "Value is unexpectedly empty. This is a bug."</div><div>




<br></div><div>    instead of</div><div><br></div><div>        fromMaybe (error "Value is unexpectedly empty. This is a bug.") maybeValue</div><div><br></div><div>    2.</div><div>        maybeA ?: maybeB ?: c</div>




<div><br></div><div>    instead of</div><div><br></div><div>        fromMaybe (fromMaybe c maybeB) maybeA</div><div><br></div><div><b>Name collisions:</b></div><div>    </div><div>    Hayoo search gives only 6 collisions with 5 hardly fundamental libraries.</div>




<div><br></div><div><br></div><div><br></div><div>* The nickname and the operator itself are inspired by the ones from Groovy language.</div><div><br></div><div>** The symbols of the operator are a reminder of plain old ternary construct.</div>




<div><br></div><div>*** To understand the nickname look at the operator as on emoticon.</div><div><br></div></div>
<br></div></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></div></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>
</div></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>