on master help sign in
Merge pull request #82 from alexfmpe/typos
6bd2d36Hamish Mackenzie
README.md+4−4
@@ -123,7 +123,7 @@ JavaScript thread until the Haskell callback completes) or asynchronous.
123### Why use a JavaScript command interpreter?
123### Why use a JavaScript command interpreter?
124
124
125Older versions of JSaddle relied on the WebKit1 interface to WebKitGTK and JavaScriptCore that is only supported in older versions of
125Older versions of JSaddle relied on the WebKit1 interface to WebKitGTK and JavaScriptCore that is only supported in older versions of
126−WebKitGTK. With the newer WekKit2 interface this level of access is only available to WebKit Extensions.
126+WebKitGTK. With the newer WebKit2 interface this level of access is only available to WebKit Extensions.
127The general advice for people migrating from WebKit1 to WebKit2 seems to be to use JavaScript.
127The general advice for people migrating from WebKit1 to WebKit2 seems to be to use JavaScript.
128
128
129As a bonus we have been able to support a number of different platforms with the JavaScript command interpreter and it should
129As a bonus we have been able to support a number of different platforms with the JavaScript command interpreter and it should
@@ -138,7 +138,7 @@ these values. Both the Haskell code and `jsaddle.js` can allocate new `JSVal` k
138keys and `jsaddle.js` allocates positive keys to avoid clashing.
138keys and `jsaddle.js` allocates positive keys to avoid clashing.
139
139
140The haskell code will not know the value of the to go with the key, but it will include it in commands to the server
140The haskell code will not know the value of the to go with the key, but it will include it in commands to the server
141−that are sort of "hey call this function and and put the result in the map with this key"). This allows for the
141+that are sort of "hey call this function and put the result in the map with this key"). This allows for the
142lazy execution of the JSaddle code.
142lazy execution of the JSaddle code.
143
143
144A finalizer is added on the Haskell code and an asynchronous `FreeJSVal` command is automatically sent to `jsaddle.js`
144A finalizer is added on the Haskell code and an asynchronous `FreeJSVal` command is automatically sent to `jsaddle.js`
@@ -146,7 +146,7 @@ when the JSVal is no longer reachable. The `jsaddle.js` code then deletes the k
146
146
147### JSStrings
147### JSStrings
148
148
149−These are haskell `Text` type and so reside on the native side of the WebSocket. If you want to make avoid transferring large string values over the WebSocket use `toJSVal` to conevt it to a `JSVal`.
149+These are haskell `Text` type and so reside on the native side of the WebSocket. If you want to make avoid transferring large string values over the WebSocket use `toJSVal` to convert it to a `JSVal`.
150
150
151### Lazy Execution
151### Lazy Execution
152
152
@@ -178,7 +178,7 @@ force all the pending asynchronous commands to be executed.
178It uses a handful of JS FFI calls to execute JavaScript functions indirectly. This indirection will be small compared to the overhead of the WebSockets approach (used when JSaddle is compiled with GHC), but it will be significant compared to hand crafted JS FFI calls.
178It uses a handful of JS FFI calls to execute JavaScript functions indirectly. This indirection will be small compared to the overhead of the WebSockets approach (used when JSaddle is compiled with GHC), but it will be significant compared to hand crafted JS FFI calls.
179
179
180For the best performance you may want to write both JS FFI and JSaddle wrappers
180For the best performance you may want to write both JS FFI and JSaddle wrappers
181−For your JavaScript code. This is the approach taken by `ghcjs-dom`.
181+for your JavaScript code. This is the approach taken by `ghcjs-dom`.
182
182
183For instance here is `getElementById` from the `ghcjs-dom-jsffi` (used by `ghcjs-dom` when compiled with GHCJS)
183For instance here is `getElementById` from the `ghcjs-dom-jsffi` (used by `ghcjs-dom` when compiled with GHCJS)
184
184
jsaddle/src/Language/Javascript/JSaddle.hs+5−5
@@ -9,7 +9,7 @@
9-- | This package provides an EDSL for calling JavaScript that
9-- | This package provides an EDSL for calling JavaScript that
10-- can be used both from GHCJS and GHC. When using GHC
10-- can be used both from GHCJS and GHC. When using GHC
11-- the application is run using Warp and WebSockets to
11-- the application is run using Warp and WebSockets to
12−-- drive a small JavaScipt helper.
12+-- drive a small JavaScript helper.
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14
14
15module Language.Javascript.JSaddle (
15module Language.Javascript.JSaddle (
@@ -35,10 +35,10 @@ module Language.Javascript.JSaddle (
35 --
35 --
36 -- Where it makes sense code examples are given in two forms. One
36 -- Where it makes sense code examples are given in two forms. One
37 -- that uses 'eval' to run a purely JavaScript version and one that
37 -- that uses 'eval' to run a purely JavaScript version and one that
38− -- uses more of the JSaddle EDSL feature being demonstated.
38+ -- uses more of the JSaddle EDSL feature being demonstrated.
39
39
40 -- * Calling Haskell from JavaScript
40 -- * Calling Haskell from JavaScript
41− -- | You can call back into haskell from JavaScript using 'fun' to
41+ -- | You can call back into Haskell from JavaScript using 'fun' to
42 -- convert a Haskell function in the JSM monad into a javascript
42 -- convert a Haskell function in the JSM monad into a javascript
43 -- value.
43 -- value.
44
44
@@ -52,8 +52,8 @@ module Language.Javascript.JSaddle (
52 -- and the server will run the Haskell code. The JSaddle parts will
52 -- and the server will run the Haskell code. The JSaddle parts will
53 -- be executed by sending commands back to the browser.
53 -- be executed by sending commands back to the browser.
54
54
55− -- Although the code JavaScript code is executed in the the strict order
55+ -- Although the JavaScript code is executed in the strict order
56− -- set out by the EDSL it done asynchonously to the Haskell code.
56+ -- set out by the EDSL it is done asynchronously to the Haskell code.
57 -- This improves the performance by reducing the number of round trips
57 -- This improves the performance by reducing the number of round trips
58 -- needed between the Haskell and JavaScript code.
58 -- needed between the Haskell and JavaScript code.
59
59