<div dir="ltr"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 10, 2014 at 8:43 AM, Andreas Abel <span dir="ltr"><<a href="mailto:andreas.abel@ifi.lmu.de" target="_blank">andreas.abel@ifi.lmu.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 10.12.2014 17:33, John Lato wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I don't really understand why people want this. What's wrong with (=<<)<br>
?  I kind of feel like a named function should be no longer than that.<br>
</blockquote>
<br></span>
You are right, we do not need a alphabetic version of every operator. We do not have<br>
<br>
  plus = (+)<br>
<br>
either.  Why take another good name from the user, just to avoid using an operator in parentheses?<br></blockquote><div><br></div><div>As a default rule, I think every operator should have a named function. This is because symbols have no inherit meaning, but words do.</div><div>Math is the exception to the rule. Basic math is universal: someone coming from any background will immediately recognize (+), (-), etc.</div><div>Monad operators only seem universal once you have been programming Haskell for several years :)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
I am -1 on the whole business here.<br>
<br>
Cheers,<br>
Andreas<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
<br>
I don't object, especially if others think it's useful (and many clearly<br>
do), but I guess it's not to my taste.<br>
<br>
<br>
On 08:02, Wed, Dec 10, 2014 David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a><br></span><span class="">
<mailto:<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>><u></u>> wrote:<br>
<br>
    joinMap looks to me like the best name, because it does just what it<br>
    says on the box:<br>
<br>
    join . fmap f $ m<br>
    = (m >>= return . f) >>= id --Functor/Monad law<br>
    = m >>= (\x -> return (f x) >>= id) --associativity<br>
    = m >>= (\x -> f x) --left identity<br>
    = m >>= f --eta reduction<br>
    = f =<< m<br>
<br></span>
    Christopher Done <<a href="mailto:chrisdone@gmail.com" target="_blank">chrisdone@gmail.com</a> <mailto:<a href="mailto:chrisdone@gmail.com" target="_blank">chrisdone@gmail.com</a>>><div><div class="h5"><br>
    writes:<br>
<br>
     > Is this defined anywhere in base, and if not could it be placed in<br>
     > Control.Monad? I often find myself writing:<br>
     ><br>
     > fmap (mu bar)<br>
     >      (foo zot)<br>
     ><br>
     > Then I decide to change the type of x, so instead I want to just<br>
     > write:<br>
     ><br>
     > bind (mu bar)<br>
     >      (foo zot)<br>
     ><br>
     > Which is just like fmap but the function can run in the<br>
     > monad. Similar to traverse:<br>
     ><br>
     > (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)<br>
     ><br>
     > As someone who isn’t a fan of operators, I generally am appreciative<br>
     > of alternative regular plain English word versions of functions,<br>
    which<br>
     > I find easier to type, read and edit. Currently without defining such<br>
     > a handy name, I have to transform the code to this:<br>
     ><br>
     > mu bar =<<foo zot<br>
     ><br>
     > The name for this function is a no-brainer:<br>
     ><br>
     > bind :: Monad m => (a -> m b) -> m a -> m bbind = (=<<)<br>
<br>
    I'm -1 on the *name* `bind`, because as others have mentioned, I<br>
    feel bind<br>
    has the same type as (>>=).<br>
<br>
    That said, I'm +1 on the *idea* - if we can find a better name.<br>
    `joinMap`<br>
    doesn't seem too bad, as was recently suggested, but I'll settle on<br>
    anything other than `bind`<br>
<br>
    -- ocharles<br>
<br>
    ______________________________<u></u>_________________<br>
    Libraries mailing list<br></div></div>
    <a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a> <mailto:<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>
<br>
    ______________________________<u></u>___________________<span class=""><br>
    Libraries mailing list<br>
    <a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a> <mailto:<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a>><br></span>
    <a href="http://www.haskell.org/__mailman/listinfo/libraries" target="_blank">http://www.haskell.org/__<u></u>mailman/listinfo/libraries</a><span class=""><br>
    <<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/libraries</a>><br>
<br>
<br>
<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>
<br>
</span></blockquote>
<br><span class="im">
<br>
-- <br>
Andreas Abel  <><      Du bist der geliebte Mensch.<br>
<br>
Department of Computer Science and Engineering<br>
Chalmers and Gothenburg University, Sweden<br>
<br>
<a href="mailto:andreas.abel@gu.se" target="_blank">andreas.abel@gu.se</a><br>
<a href="http://www2.tcs.ifi.lmu.de/~abel/" target="_blank">http://www2.tcs.ifi.lmu.de/~<u></u>abel/</a><br></span><div class=""><div class="h5">
______________________________<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></div>