<div dir="ltr">Not sure if this applies here, but withSocketsDo is a huge gotcha.<div><br></div><div>It doesn&#39;t affect Linux, but all networking code on BSD(?)/Windows that doesn&#39;t use it fails to boot with an unfriendly runtime error (and many people leave it out).</div>
<div><br></div><div>A warning for this would be good.<br><div><br></div><div>Regards.</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 23, 2013 at 8:00 PM,  <span dir="ltr">&lt;<a href="mailto:ghc-devs-request@haskell.org" target="_blank">ghc-devs-request@haskell.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send ghc-devs mailing list submissions to<br>
        <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:ghc-devs-request@haskell.org">ghc-devs-request@haskell.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:ghc-devs-owner@haskell.org">ghc-devs-owner@haskell.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of ghc-devs digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. Language level heads-up warnings (David Luposchainsky)<br>
   2. RE: Language level heads-up warnings (Simon Peyton-Jones)<br>
   3. Re: Language level heads-up warnings (David Luposchainsky)<br>
   4. RE: Language level heads-up warnings (Simon Peyton-Jones)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 22 May 2013 13:36:18 +0200<br>
From: David Luposchainsky &lt;<a href="mailto:dluposchainsky@googlemail.com">dluposchainsky@googlemail.com</a>&gt;<br>
Subject: Language level heads-up warnings<br>
To: <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
Message-ID: &lt;<a href="mailto:519CADB2.5080904@gmail.com">519CADB2.5080904@gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Hello GHC-Devs,<br>
<br>
The discussion on the libraries mailing list brought up the issue of<br>
breaking compatbility in favour of language evolution/sanitation again;<br>
topics mentioned specifically were Prelude&#39;s monomorphic<br>
Foldable/Traversable functions, and the Applicative/Monad issue.<br>
<br>
The main arguments of both sides are these:<br>
<br>
(+) We&#39;ve been aware of certain unfortunate features of Base for a long<br>
time, and we understand very well how to fix this, and what the<br>
consequences are.<br>
<br>
(-) Changing core language features is something you can never forsee<br>
the consequences of. Breaking compatibility should be avoided at all costs.<br>
<br>
(There&#39;s also the argument about beginner friendliness, which is not<br>
backed by evidence, so I&#39;ll leave it out here.)<br>
<br>
These two seem contradictory, however they have one almost obvious<br>
common ground: we can already write code right now that will be<br>
unaffected by moving Foldable/Traversable/Applicative+Monad to the<br>
Prelude. Suppose all code is written with this in mind, the change is<br>
trivial.<br>
<br>
Which brings us to the actual problem, namely that code is not written<br>
with this in mind. It is easy to forget about the issue in a practical<br>
setting, regardless of how small the required effort is. Therefore, I&#39;d<br>
like to bring forward the idea of &quot;language level heads-up warnings&quot;<br>
(suggestions for better names appreciated).<br>
<br>
Right now, we can only deprecate functions. When used, GHC informs us<br>
&quot;hey, this will work for now, but better use that in the future&quot;.<br>
However, this mechanism is too specialized to tackle the problem above:<br>
for example, there is no way to warn a user about a Monad that is not an<br>
Applicative.<br>
<br>
If the community agrees on making one of the &quot;big&quot; changes, what would<br>
you think of adding warnings about language usage? I&#39;m sure over the<br>
course of a couple of GHC releases, the great majority of libraries<br>
would be modified to rectify these warnings again. If you want an<br>
example: &quot;Warning: Monad without Applicative. This will be enforced in a<br>
future language standard.&quot;<br>
<br>
These warnings would have to be hardcoded into GHC, but keep in mind<br>
that this is only for very few, relatively high impact changes, and can<br>
be removed once everything is done. In my opinion, this may be a far<br>
better transitional feature than the alternative (adding compatibility<br>
modules, convincing thousands of developers to listen to the people in<br>
favour of the change, ...).<br>
<br>
Greetings,<br>
David<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Wed, 22 May 2013 13:42:10 +0000<br>
From: Simon Peyton-Jones &lt;<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>&gt;<br>
Subject: RE: Language level heads-up warnings<br>
To: David Luposchainsky &lt;<a href="mailto:dluposchainsky@googlemail.com">dluposchainsky@googlemail.com</a>&gt;,<br>
        &quot;<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>&quot; &lt;<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>&gt;<br>
Message-ID:<br>
        &lt;<a href="mailto:59543203684B2244980D7E4057D5FBC1481A7305@DB3EX14MBXC306.europe.corp.microsoft.com">59543203684B2244980D7E4057D5FBC1481A7305@DB3EX14MBXC306.europe.corp.microsoft.com</a>&gt;<br>
<br>
Content-Type: text/plain; charset=&quot;us-ascii&quot;<br>
<br>
Yes, I think that if the libraries community thought it was important, I (or indeed someone else) could add a couple of ad-hoc warnings to GHC without much work. But you&#39;d all need to be clear and specific about what warnings were wanted, and they&#39;d need to be easy to check (ie no global program analysis).<br>

<br>
Simon<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:ghc-devs-bounces@haskell.org">ghc-devs-bounces@haskell.org</a> [mailto:<a href="mailto:ghc-devs-bounces@haskell.org">ghc-devs-bounces@haskell.org</a>] On Behalf Of David Luposchainsky<br>
Sent: 22 May 2013 12:36<br>
To: <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
Subject: Language level heads-up warnings<br>
<br>
Hello GHC-Devs,<br>
<br>
The discussion on the libraries mailing list brought up the issue of breaking compatbility in favour of language evolution/sanitation again; topics mentioned specifically were Prelude&#39;s monomorphic Foldable/Traversable functions, and the Applicative/Monad issue.<br>

<br>
The main arguments of both sides are these:<br>
<br>
(+) We&#39;ve been aware of certain unfortunate features of Base for a long time, and we understand very well how to fix this, and what the consequences are.<br>
<br>
(-) Changing core language features is something you can never forsee the consequences of. Breaking compatibility should be avoided at all costs.<br>
<br>
(There&#39;s also the argument about beginner friendliness, which is not backed by evidence, so I&#39;ll leave it out here.)<br>
<br>
These two seem contradictory, however they have one almost obvious common ground: we can already write code right now that will be unaffected by moving Foldable/Traversable/Applicative+Monad to the Prelude. Suppose all code is written with this in mind, the change is trivial.<br>

<br>
Which brings us to the actual problem, namely that code is not written with this in mind. It is easy to forget about the issue in a practical setting, regardless of how small the required effort is. Therefore, I&#39;d like to bring forward the idea of &quot;language level heads-up warnings&quot;<br>

(suggestions for better names appreciated).<br>
<br>
Right now, we can only deprecate functions. When used, GHC informs us &quot;hey, this will work for now, but better use that in the future&quot;.<br>
However, this mechanism is too specialized to tackle the problem above:<br>
for example, there is no way to warn a user about a Monad that is not an Applicative.<br>
<br>
If the community agrees on making one of the &quot;big&quot; changes, what would you think of adding warnings about language usage? I&#39;m sure over the course of a couple of GHC releases, the great majority of libraries would be modified to rectify these warnings again. If you want an<br>

example: &quot;Warning: Monad without Applicative. This will be enforced in a future language standard.&quot;<br>
<br>
These warnings would have to be hardcoded into GHC, but keep in mind that this is only for very few, relatively high impact changes, and can be removed once everything is done. In my opinion, this may be a far better transitional feature than the alternative (adding compatibility modules, convincing thousands of developers to listen to the people in favour of the change, ...).<br>

<br>
Greetings,<br>
David<br>
<br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Wed, 22 May 2013 15:54:02 +0200<br>
From: David Luposchainsky &lt;<a href="mailto:dluposchainsky@googlemail.com">dluposchainsky@googlemail.com</a>&gt;<br>
Subject: Re: Language level heads-up warnings<br>
To: &quot;<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>&quot; &lt;<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:519CCDFA.40009@gmail.com">519CCDFA.40009@gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
On 2013-05-22 15:42, Simon Peyton-Jones wrote:<br>
&gt; Yes, I think that if the libraries community thought it was<br>
&gt; important, I (or indeed someone else) could add a couple of ad-hoc<br>
&gt; warnings to GHC without much work. But you&#39;d all need to be clear and<br>
&gt; specific about what warnings were wanted, and they&#39;d need to be easy<br>
&gt; to check (ie no global program analysis).<br>
<br>
Simon,<br>
<br>
good to hear that it&#39;s worth thinking about.<br>
<br>
I&#39;m not sure what exactly &quot;no global program analysis&quot; means here. Where<br>
would the boundaries of such warnings be? I could imagine problems if<br>
Applicative/Monad are defined in separate packages/modules (although<br>
that may be rare in practice).<br>
<br>
Greetings,<br>
David<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Wed, 22 May 2013 13:59:03 +0000<br>
From: Simon Peyton-Jones &lt;<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>&gt;<br>
Subject: RE: Language level heads-up warnings<br>
To: David Luposchainsky &lt;<a href="mailto:dluposchainsky@googlemail.com">dluposchainsky@googlemail.com</a>&gt;,<br>
        &quot;<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>&quot; &lt;<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>&gt;<br>
Message-ID:<br>
        &lt;<a href="mailto:59543203684B2244980D7E4057D5FBC1481A745D@DB3EX14MBXC306.europe.corp.microsoft.com">59543203684B2244980D7E4057D5FBC1481A745D@DB3EX14MBXC306.europe.corp.microsoft.com</a>&gt;<br>
<br>
Content-Type: text/plain; charset=&quot;us-ascii&quot;<br>
<br>
I&#39;m just saying that GHC has to be able to check while compiling one module, ie as now.  (It can see details of the things it imports, obviously, since it needs to know that to compile the module)<br>
<br>
| -----Original Message-----<br>
| From: David Luposchainsky [mailto:<a href="mailto:dluposchainsky@googlemail.com">dluposchainsky@googlemail.com</a>]<br>
| Sent: 22 May 2013 14:54<br>
| To: <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
| Cc: Simon Peyton-Jones<br>
| Subject: Re: Language level heads-up warnings<br>
|<br>
| On 2013-05-22 15:42, Simon Peyton-Jones wrote:<br>
| &gt; Yes, I think that if the libraries community thought it was<br>
| &gt; important, I (or indeed someone else) could add a couple of ad-hoc<br>
| &gt; warnings to GHC without much work. But you&#39;d all need to be clear and<br>
| &gt; specific about what warnings were wanted, and they&#39;d need to be easy<br>
| &gt; to check (ie no global program analysis).<br>
|<br>
| Simon,<br>
|<br>
| good to hear that it&#39;s worth thinking about.<br>
|<br>
| I&#39;m not sure what exactly &quot;no global program analysis&quot; means here. Where<br>
| would the boundaries of such warnings be? I could imagine problems if<br>
| Applicative/Monad are defined in separate packages/modules (although<br>
| that may be rare in practice).<br>
|<br>
| Greetings,<br>
| David<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
<br>
<br>
End of ghc-devs Digest, Vol 117, Issue 43<br>
*****************************************<br>
</blockquote></div><br></div>