<div dir="ltr">I'd favor unsnoc and uncons over viewL / viewR as the type is a bit different having no dedicated view data type, etc.<div><br></div><div>uncons seems by far more commonly reinvented name for the concept, being used across bytestring, parsec, etc.</div>
<div><br></div><div><a href="https://www.fpcomplete.com/hoogle?q=uncons&env=ghc-7.4.2-stable-13.09">https://www.fpcomplete.com/hoogle?q=uncons&env=ghc-7.4.2-stable-13.09</a><br></div><div><br></div><div>While the viewL/viewR's out there all have their heritage in the Data.Seq / fingertree usage.</div>
<div><br></div><div><a href="https://www.fpcomplete.com/hoogle?q=viewl&env=ghc-7.4.2-stable-13.09">https://www.fpcomplete.com/hoogle?q=viewl&env=ghc-7.4.2-stable-13.09</a><br></div><div><br></div><div>I tend to reserve using viewL / viewR for the dedicated data type variant, as because the latter fits in a bit worse with other uses of Maybe but can be ever so slightly more efficient due to the dedicated constructor I often try to supply both.</div>
<div><br></div><div>Also a motivation for the uncons nomenclature is it preserves something like symmetry between </div><div>`unfoldr uncons` and `foldr (:) []`.</div><div><br></div><div>It is a much easier to sell an uncons/unsnoc than to sell new data types and a viewL/viewR to go with them, and it seems to me to be better to reserve the latter names for folks who do want to supply such a beast.</div>
<div><br></div><div><div>-Edward</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jul 20, 2014 at 12:07 AM, Henning Thielemann <span dir="ltr"><<a href="mailto:schlepptop@henning-thielemann.de" target="_blank">schlepptop@henning-thielemann.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 20.07.2014 05:01, schrieb wren romano:<div class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yes, uncons is a view, but I see no benefit in naming the function<br>
after that fact— given that "uncons" is the standard/popular name, and<br>
that we don't typically name any other views "viewFoo".<br>
</blockquote>
<br></div>
As I said, I chose the name according to Data.Sequence:<br>
<br>
<a href="http://hackage.haskell.org/package/containers-0.5.5.1/docs/Data-Sequence.html#v:viewl" target="_blank">http://hackage.haskell.org/<u></u>package/containers-0.5.5.1/<u></u>docs/Data-Sequence.html#v:<u></u>viewl</a><br>

<br>
<br>
There is also:<br>
<a href="http://hackage.haskell.org/package/containers-0.5.5.1/docs/Data-Map-Lazy.html#v:minView" target="_blank">http://hackage.haskell.org/<u></u>package/containers-0.5.5.1/<u></u>docs/Data-Map-Lazy.html#v:<u></u>minView</a><br>

<a href="http://hackage.haskell.org/package/containers-0.5.5.1/docs/Data-Set.html#v:minView" target="_blank">http://hackage.haskell.org/<u></u>package/containers-0.5.5.1/<u></u>docs/Data-Set.html#v:minView</a><br>
<br>
<br>
But I am not bound to it.<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<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/<u></u>mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div>