Errata

Parallel and Concurrent Programming in Haskell

Errata for Parallel and Concurrent Programming in Haskell

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Other Digital Version Sample code

Trying to build parcon-examples-0.3.5 on Windows using cygwin and latest GHC platform (HaskellPlatform-7.10.3-x86_64-setup).

Did the following in cygwin bash terminal:

cabal install --only_dependencies --reinstall
cabal configure
cabal build

Build fails to link geturls1.exe due to undefined references to:
initWinSock
newAcceptParams
acceptDoProc
getWSErrorDescr
shutdownWinSock
__imp_getnameinfo
__imp_getaddrinfo

They seem to be required by HTTP-4000.2.23 and network-2.4.2.3

Any suggestions or hint?

Bulent Basaran  May 18, 2016 
Printed Page xi
top line

the top line is: ...Chapters 4,5,6, and pass:[14...
what does "pass:[14" mean.

patrick lynch  Jan 02, 2017 
PDF Page 154
First code snippet (`geturl6.hs`)

Could lead to deadlock where say the `putMVar` of line `forkIO $ do r <- try (fmap Right (wait b)); putMVar m r` executes before the `putMVar` present inside `readMVar` as called by implementation of `wait` (assuming first forked thread succeeded with its `putMVar`)? For simplicity, let us assume that there are no asynchronous exceptions to worry about.

To note that `readMVar` is defined in text as:

```hs
readMVar :: MVar a -> IO a
readMVar m = do
a <- takeMVar m
putMVar m a
return a
```

And text acknowledges that such a situation is possible (albeit in different context) in fourth paragraph of page 160.

Sourabh Aggarwal  Jul 03, 2024 
Printed Page 206
second code listing (main function)

The code seems to use api's that no longer exist. I was able to get it running by changing it to this:


main = withSocketsDo $ do
sock <- socket AF_INET Stream defaultProtocol -- 1
setSocketOption sock ReuseAddr 1
bind sock (SockAddrInet port (tupleToHostAddress (127, 0, 0, 1)))
listen sock 2
printf "Listening on port %s\n" (show port)
forever $ do -- 2
(clientSock, addr) <- accept sock -- 3
handle <- socketToHandle clientSock ReadWriteMode
printf "Accepted connection from %s\n" (show addr)
forkFinally (talk handle) (\_ -> hClose handle) -- 4

Anonymous  Feb 25, 2024