On Wed, Mar 13, 2013 at 2:58 AM, David Luposchainsky <span dir="ltr"><<a href="mailto:dluposchainsky@googlemail.com" target="_blank">dluposchainsky@googlemail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
1. void is currently in Control.Monad. However, it is defined<br>
only in terms of fmap (and therefore only has a Functor<br>
constraint). Although this function is often used in a<br>
monadic setting as ">> return ()", I really don't think<br>
Control.Monad is the right place for it.<br></blockquote><div><br></div><div>We could reexported the function in both places so we don't have to break code that depends on its current location.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2. a) swap is the only function from Data.Tuple that is not<br>
exported to Prelude. On #haskell, people are sometimes<br>
even surprised there /is/ a Data.Tuple, and redefine<br>
their own version of swap at need. I therefore suggest<br>
including Data.Tuple.swap in the Prelude.<br>
<br>
The obvious downside of this change would of course be<br>
that it breaks code if there is a top-level user-defined<br>
version of it. Fixing this is of course trivial, but<br>
necessary.<br></blockquote><div><br></div><div>I don't think we should add any more functions to the Prelude. It's a module that's automatically put into scope into every module (unless you explicitly use NoImplicitPrelude). Putting things in a global namespace like that is bad.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
b) A related suggestion would be the addition of an<br>
irrefutable swap, (swap'?), defined as<br>
"swap ~(a,b) = (b,a)", and its addition to Prelude for<br>
the same reasons.<br></blockquote><div><br></div><div>Add it to Data.Tuple.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">3. $>, a flipped version of <$, currently resides in<br>
Control.Comonad, but should be in Data.Functor. Applicative<br>
has <* and *>, Monad has >>= and =<<, and I personally keep<br>
redefining (or specifically importing) $> quite often, and I<br>
don't think I'm the only one.<br></blockquote><div><br></div><div>Makes sense to me.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As these are quite small changes I think 2 weeks should be a<br>
sufficiently long discussion period.<br></blockquote><div><br></div><div>Adding things to the Prelude is not a small thing! :)</div><div><br></div><div>-- Johan</div><div> </div></div>