git.iko.soy/distributed-process
on master help sign in
Add comment explaining correction to matchIf
e0a69a8Edsko de Vries
distributed-process/src/Control/Distributed/Process/Internal/Primitives.hs+3
@@ -271,6 +271,9 @@ matchIf c p = Match $ \msg ->
271 True | c decoded -> Just (p decoded)
271 True | c decoded -> Just (p decoded)
272 where
272 where
273 decoded :: a
273 decoded :: a
274+ -- Make sure the value is fully decoded so that we don't hang to
275+ -- bytestrings when the process calling 'matchIf' doesn't process
276+ -- the values immediately
274 !decoded = decode (messageEncoding msg)
277 !decoded = decode (messageEncoding msg)
275 _ -> Nothing
278 _ -> Nothing
276
279