<p dir="ltr">If you want something even simpler:</p>
<p dir="ltr">asum [Nothing, Just True, Nothing, Just False]</p>
<p dir="ltr">From Data.Foldable :)</p>
<br><div class="gmail_quote"><div dir="ltr">On Wed, 28 Dec 2016, 10:56 am Imants Cekusins, <<a href="mailto:imantc@gmail.com">imantc@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">discovered this handy snippet today (duh :):</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">>>> foldl (<|>) Nothing [Nothing, Just 1, Nothing, Just 2]</div><div class="gmail_msg">Just 1</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">basically, pick first Just from a list of Maybes</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><a href="http://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Applicative.html#g:2" class="gmail_msg" target="_blank">http://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Applicative.html#g:2</a><br class="gmail_msg"></div>
_______________________________________________<br class="gmail_msg">
Beginners mailing list<br class="gmail_msg">
<a href="mailto:Beginners@haskell.org" class="gmail_msg" target="_blank">Beginners@haskell.org</a><br class="gmail_msg">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" class="gmail_msg" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br class="gmail_msg">
</blockquote></div>