Skip to content

Commit 8392088

Browse files
authored
Merge pull request #38 from Abhiroop/master
Make the code typecheck
2 parents 3d36de6 + ca5226e commit 8392088

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Diff for: tutorials/3ch.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,11 @@ of exit reasons.
285285

286286
{% highlight haskell %}
287287
demo = do
288-
pid <- spawnLocal $ receive >>= return
288+
pid <- spawnLocal $ expect >>= return
289289
link pid
290290
send pid ()
291-
() <- receive
291+
() <- expect
292+
return ()
292293
{% endhighlight %}
293294

294295
The medium that link failures uses to signal exit conditions is the same as exit and kill

Diff for: tutorials/4ch.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ module MathServer
120120
, launchMathServer
121121
) where
122122

123+
import Control.Distributed.Process.ManagedProcess -- from the package `distributed-process-client-server`
124+
import Control.Distributed.Process.Extras.Time -- from the package `distributed-process-extras`
123125
import .... -- elided
124126

125127
-- We keep this data-type hidden from the outside world, and we ignore
@@ -148,7 +150,7 @@ launchMathServer =
148150
apiHandlers = [ handleCall_ (\(Add x y) -> return (x + y)) ]
149151
, unhandledMessagePolicy = Drop
150152
}
151-
in spawnLocal $ start () (statelessInit Infinity) server >> return ()
153+
in spawnLocal $ serve () (statelessInit Infinity) server >> return ()
152154
{% endhighlight %}
153155

154156

@@ -191,7 +193,7 @@ launchMathServer =
191193
apiHandlers = [ handleRpcChan_ (\chan (Add x y) -> sendChan chan (x + y)) ]
192194
, unhandledMessagePolicy = Drop
193195
}
194-
in spawnLocal $ start () (statelessInit Infinity) server >> return ()
196+
in spawnLocal $ serve () (statelessInit Infinity) server >> return ()
195197
{% endhighlight %}
196198

197199
Ensuring that only valid types are sent to the server is relatively simple,
@@ -230,7 +232,7 @@ launchMathServer =
230232
, handleCast_ (\(Add x y) -> liftIO $ putStrLn $ show (x + y) >> continue_) ]
231233
, unhandledMessagePolicy = Drop
232234
}
233-
in spawnLocal $ start () (statelessInit Infinity) server >> return ()
235+
in spawnLocal $ serve () (statelessInit Infinity) server >> return ()
234236
{% endhighlight %}
235237

236238

0 commit comments

Comments
 (0)