@@ -13,9 +13,9 @@ using a remote monad.
1313** javascript-bridge** remotely executes JavaScript * fragments* .
1414The basic Haskell idiom is.
1515``` Haskell
16- send eng $ command " console.log('Hello!')"
16+ send eng $ command " console.log('Hello!')"
1717```
18- where ` send ` is an ` IO ` function that sends a commands for remote exection ,
18+ where ` send ` is an ` IO ` function that sends a commands for remote execution ,
1919` eng ` is a handle into a specific JavaScript engine,
2020and ` command ` is a command builder.
2121
@@ -43,7 +43,7 @@ then listening for the event in Haskell.
4343
4444```Haskell
4545 do -- Have JavaScript send an event to Haskell
46- send eng $ command $ " event('Hello!')"
46+ send eng $ command $ event ('Hello! ':: String )"
4747 -- Have Haskell wait for the event, which is an Aeson 'Value'.
4848 e :: Value <- listen eng
4949 print e
@@ -55,15 +55,15 @@ Bootstrapping the connection is straightforward.
5555First, use a `middleware` to setup the (Haskell) server.
5656
5757```Haskell
58- import qualified Network.JavaScript as JS
58+ import qualified Network.JavaScript
5959
6060 ...
6161 scotty 3000 $ do
62- middleware $ JS . start app
62+ middleware $ start app
6363 ...
6464
6565app :: Engine -> IO ()
66- app = send eng $ command " console.log('Hello!')"
66+ app eng = send eng $ command " console. log ('Hello! ')"
6767```
6868
6969Next, include the following fragment in your HTML code.
0 commit comments