on master help sign in
Fix typos
commitcb8ada8eb403d1f770a1d3dcdb1bb169b0424401 authorAlexandre Esteves <alexandre.fmp.esteves@gmail.com> dateSat 26 Jan 2019, 03:03 (8 years ago) parenta9acbcf
2 files changed+9−9
README.md+4−4 jsaddle/src/Language/Javascript/JSaddle.hs+5−5
README.md+4−4
@@ -123,7 +123,7 @@ JavaScript thread until the Haskell callback completes) or asynchronous.
123123### Why use a JavaScript command interpreter?
124124
125125Older 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.
127127The general advice for people migrating from WebKit1 to WebKit2 seems to be to use JavaScript.
128128
129129As 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
138138keys and `jsaddle.js` allocates positive keys to avoid clashing.
139139
140140The 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
142142lazy execution of the JSaddle code.
143143
144144A 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
146146
147147### JSStrings
148148
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`.
150150
151151### Lazy Execution
152152
@@ -178,7 +178,7 @@ force all the pending asynchronous commands to be executed.
178178It 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.
179179
180180For 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`.
182182
183183For instance here is `getElementById` from the `ghcjs-dom-jsffi` (used by `ghcjs-dom` when compiled with GHCJS)
184184
jsaddle/src/Language/Javascript/JSaddle.hs+5−5
@@ -9,7 +9,7 @@
99-- | This package provides an EDSL for calling JavaScript that
1010-- can be used both from GHCJS and GHC. When using GHC
1111-- the application is run using Warp and WebSockets to
12−-- drive a small JavaScipt helper.
12+-- drive a small JavaScript helper.
1313-----------------------------------------------------------------------------
1414
1515module Language.Javascript.JSaddle (
@@ -35,10 +35,10 @@ module Language.Javascript.JSaddle (
3535 --
3636 -- Where it makes sense code examples are given in two forms. One
3737 -- 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.
3939
4040 -- * 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
4242 -- convert a Haskell function in the JSM monad into a javascript
4343 -- value.
4444
@@ -52,8 +52,8 @@ module Language.Javascript.JSaddle (
5252 -- and the server will run the Haskell code. The JSaddle parts will
5353 -- be executed by sending commands back to the browser.
5454
55− -- Although the code JavaScript code is executed in the the strict order
56− -- set out by the EDSL it done asynchonously to the Haskell code.
55+ -- Although the JavaScript code is executed in the strict order
56+ -- set out by the EDSL it is done asynchronously to the Haskell code.
5757 -- This improves the performance by reducing the number of round trips
5858 -- needed between the Haskell and JavaScript code.
5959