-
Notifications
You must be signed in to change notification settings - Fork 177
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
Tidy up the manual #561
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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.
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, sounds good to me. I just feel a bit silly angling for credit with such basic diffs. ;-) |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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