Re: Proposal: System.Timeout module for base (Trac #980)

The documentation for the module is excellent. Could you add a few-lines example for an intended usage? Examples greatly shorten in a few ways time needed to start using some API. First, they are complementary explanation to other information. Second, someone can just copy an example to start playing with it. Another thing - in the header comments you mentioned that the module is "non-portable". Could you add an explanation why the module is non-portable? Thanks, Andriy ____________________________________________________________________________________ Yahoo! Music Unlimited Access over 1 million songs. http://music.yahoo.com/unlimited

Andriy Palamarchuk writes:
The documentation for the module is excellent.
Thank you. :-)
Could you add a few-lines example for an intended usage?
Yes, that is a good idea. I have attached a new version below. Peter

Oops, I almost forgot to respond to this point:
Could you add an explanation why the module is non-portable?
The module is unportable because it relies on asynchronous, dynamically-typed exceptions. That is a GHC extension, as far as I know. I guess it might be worth mentioning the exact details somewhere, but then I don't want to clutter the module header with long text -- almost all modules I have seen just say "non-portable" in that header field. If it's not a major point, I'd prefer to keep things the way they are in that regard. Of course, all kinds of patches are always welcome. ;-) Peter

Peter Simons wrote:
Oops, I almost forgot to respond to this point:
Could you add an explanation why the module is non-portable?
The module is unportable because it relies on asynchronous, dynamically-typed exceptions. That is a GHC extension, as far as I know. I guess it might be worth mentioning the exact details somewhere, but then I don't want to clutter the module header with long text -- almost all modules I have seen just say "non-portable" in that header field. If it's not a major point, I'd prefer to keep things the way they are in that regard.
Often I add a few keywords in parentheses after non-portable, e.g. Portability: non-portable (exceptions, concurrency) but what might be more useful nowadays is to use the LANGUAGE pragma to specify extensions, and copy the value of the LANGUAGE pragma into the Portability field for documentation. It would be nice if Haddock automatically populated Portability from LANGUAGE, in fact. Cheers, Simon

Simon Marlow writes:
LANGUAGE pragma
I wasn't aware that pragma exists! Apparently it would be a good idea to re-read the GHC documentation every now and then. ;-) The revised module is attached below. On a more personal note, I'd like to point out how much easier improving this module would be for everyone if it were available in a darcs repository. One of the nicest things about darcs is that it makes it quite simple to contribute patches. You just say "record", then you say "send", and then it's done! I feel http://darcs.haskell.org/packages/base would be a great place to make the module available for everyone to contribute. Best regards Peter

Hello Peter, Friday, March 2, 2007, 7:59:51 PM, you wrote:
On a more personal note, I'd like to point out how much easier improving this module would be for everyone if it were available in a darcs repository. One of the nicest things about darcs is that it makes it quite simple to contribute patches. You just say "record", then you say "send", and then it's done! I feel http://darcs.haskell.org/packages/base would be a great place to make the module available for everyone to contribute.
... and for noone to use. don't forget that Base is the only library that can't be replaced by user without upgrading to ghc HEAD -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

I am sorry for being vague earlier. What I was trying to say is that I feel like we have discussed this timeout function for a very long time now, and I feel like I have put quite a bit of effort into this particular endeavor. I would very much like to achieve a result. Simon, in your article <45586F40.4080507@microsoft.com> you said explicitly that you were in favor of adding this function to the GHC base libraries. Do you still feel the same way? How about everyone else? Is there any reason why this function should not be added to the base library? I would very much appreciate it if we could reach some sort of conclusion within the next two weeks. Anyway, I don't want to leave a wrong impression. The discussion has been very interesting, insightful, and it has helped to improve the submission. It's just that I feel we have discussed these 15 lines of code long enough, really. Best regards, Peter

Hello Peter, Saturday, March 3, 2007, 3:37:39 AM, you wrote:
Simon, in your article <45586F40.4080507@microsoft.com> you said explicitly that you were in favor of adding this function to the GHC base libraries. Do you still feel the same way?
How about everyone else? Is there any reason why this function should not be added to the base library? I would very much appreciate it if we could reach some sort of conclusion within the next two weeks.
i agree that it is better to include this function to Base library -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Peter Simons wrote:
I am sorry for being vague earlier. What I was trying to say is that I feel like we have discussed this timeout function for a very long time now, and I feel like I have put quite a bit of effort into this particular endeavor. I would very much like to achieve a result.
Simon, in your article <45586F40.4080507@microsoft.com> you said explicitly that you were in favor of adding this function to the GHC base libraries. Do you still feel the same way?
How about everyone else? Is there any reason why this function should not be added to the base library? I would very much appreciate it if we could reach some sort of conclusion within the next two weeks.
Anyway, I don't want to leave a wrong impression. The discussion has been very interesting, insightful, and it has helped to improve the submission. It's just that I feel we have discussed these 15 lines of code long enough, really.
Quite right. I've pushed the patch now. Thanks for all your work on it. Cheers, Simon

Simon Marlow writes:
I've pushed the patch now.
Thank you very much. I'd like to apologize if I've come across as impatient every now and then. I guess I was. ;-) The implementation we have is imperfect for a number of reasons and it comes with a subtle trap or two, but I feel that having this imperfect function available is a significant step forward for many users, particularly for those who are interested in network applications. I feel that part of the reason why it was so difficult to reach consensus on this function is because so many people are interested in it. Sincerely, Peter
participants (4)
-
Andriy Palamarchuk
-
Bulat Ziganshin
-
Peter Simons
-
Simon Marlow