Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up the manual #561

Merged
merged 3 commits into from
Mar 8, 2018
Merged

Tidy up the manual #561

merged 3 commits into from
Mar 8, 2018

Conversation

aantron
Copy link
Collaborator

@aantron aantron commented Mar 7, 2018

Up-do-date docs for Lwt may be posted online again soon, so this patch tidies up the old (yet still current) manual. It's a somewhat big change to the wording, though not the structure. See the diff and commit message.

The introductory text of the new manual (#469) is still at https://ocsigen.github.io/lwt/manual-draft/Lwt.html, but it needs to be split up into pages, etc.

@jasone I actually ended up removing the "thread-local storage" section, because that mechanism is deprecated. Sorry about that, but your PR is appreciated nonetheless. Paying extra attention because of it, I found a few more typos like the ones you fixed, and I'm sure a closer look at the text will reveal many more, plus any new ones I may be introducing here :)

All feedback welcome.

cc @balat @dmbaturin

- Switch to promise terminology.
- Fix a lot of typos and similar minor errors.
- Rewrite some text.
- Point out what is deprecated or remove it.
- ...etc.

This manual is actually superseded by the text in src/core/lwt.mli,
added in #469, but that is taking a while to post, so it is probably
worth updating this now.
@jasone
Copy link
Contributor

jasone commented Mar 7, 2018

I pulled this change to see if the 'promise' terminology is introduced in an understandable way, and it looks good to me. Here are some spelling fixes I noticed for possible integration:

diff --git a/doc/manual.wiki b/doc/manual.wiki
index 4810a0f..79e382f 100644
--- a/doc/manual.wiki
+++ b/doc/manual.wiki
@@ -99,7 +99,7 @@ val p : char Lwt.t = <abstr>
      operation, that you started by calling the function that returned the
      promise, has completed successfully.
    * {{{Fail exn}}}, which means that the promise has been rejected
-     with the exception {{{exn}}}. This usually means that the asychronous
+     with the exception {{{exn}}}. This usually means that the asynchronous
      operation associated with the promise has failed.
    * {{{Sleep}}}, which means that the promise is has not yet been
      fulfilled or rejected, so it is //pending//.
@@ -226,9 +226,9 @@ val p : char Lwt.t = <abstr>
   operation associated with a promise can only be canceled if its implementation
   has taken care to set an {{{on_cancel}}} callback on the promise that
   it returned to you. In practice, most operations (such as system calls)
-  can't be canceled once they are started anyway, so promise cancelation is
+  can't be canceled once they are started anyway, so promise cancellation is
   useful mainly for interrupting future operations once you know that a chain of
-  asychronous operations will not be needed.
+  asynchronous operations will not be needed.
 
   It is also possible to cancel a promise which has not been
   created directly by you with {{{Lwt.task}}}. In this case, the deepest
@@ -569,9 +569,9 @@ val s' : int Lwt_stream.t = <abstr>
   the standard library (of type {{{in_channel}}} or
   {{{out_channel}}}), but with non-blocking semantics.
 
-  {{{Lwt_gc}}} allows you to register a finaliser that returns a
+  {{{Lwt_gc}}} allows you to register a finalizer that returns a
   promise. At the end of the program, {{{Lwt}}} will wait for all these
-  finalisers to resolve.
+  finalizers to resolve.
 
 === The Lwt scheduler ===
 
@@ -611,7 +611,7 @@ val s' : int Lwt_stream.t = <abstr>
 <<code language="ocaml"|val Lwt_main.run : 'a Lwt.t -> 'a
 >>
 
-  This function continously runs the scheduler until the promise passed
+  This function continuously runs the scheduler until the promise passed
   as argument is resolved.
 
   To make sure {{{Lwt}}} is compiled with {{{libev}}} support,
@@ -656,7 +656,7 @@ val s' : int Lwt_stream.t = <abstr>
 
   Among the added functionalities we have {{{Lwt_react.E.next}}}, which
   takes an event and returns a promise which will be pending until the next
-  occurence of this event. For example:
+  occurrence of this event. For example:
 
 <<code language="ocaml" |# open Lwt_react;;
 # let event, push = E.create ();;
@@ -674,7 +674,7 @@ val p : '_a Lwt.t = <abstr>
 
   Another interesting feature is the ability to limit events
   (resp. signals) from occurring (resp. changing) too often. For example,
-  suppose you are doing a program which displays something on the screeen
+  suppose you are doing a program which displays something on the screen
   each time a signal changes. If at some point the signal changes 1000
   times per second, you probably don't want to render it 1000 times per
   second. For that you use {{{Lwt_react.S.limit}}}:

@aantron
Copy link
Collaborator Author

aantron commented Mar 7, 2018

Thanks! @jasone, I turned your diff into a commit (d05d81b) in this PR, with you credited as author. Hope that is okay.

@jasone
Copy link
Contributor

jasone commented Mar 7, 2018

@aantron, sounds good to me. I just feel a bit silly angling for credit with such basic diffs. ;-)

@aantron aantron merged commit d05d81b into master Mar 8, 2018
@aantron
Copy link
Collaborator Author

aantron commented Mar 8, 2018

No problem, I guess every bit deserves proper credit in at least some form :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants