Merge pull request #237 from haskell-distributed/dev/issue-196
Fix wrong NFData instance for Message.
commit2b770e67200969aaaa2dbdbae8e749f4849d5b58
authorAlexander Vershilov <alexander.vershilov@gmail.com>
dateFri 19 Jun 2015, 15:33 (11 years ago)
parent6efcbc0bb57fe8
src/Control/Distributed/Process/Internal/Types.hs+2−1
@@ -380,7 +380,8 @@ instance NFData Message where
380380#else
381381 rnf (EncodedMessage _ e) = BSL.length e `seq` ()
382382#endif
383− rnf (UnencodedMessage _ a) = a `seq` () -- forced to WHNF only
383+ rnf (UnencodedMessage _ a) = e `seq` ()
384+ where e = BSL.length (encode a)
384385
385386instance Show Message where
386387 show (EncodedMessage fp enc) = show enc ++ " :: " ++ showFingerprint fp []