-- | From a result of a configuration change, determine if the
-- configuration was changed and if full distribution is needed.
-- If so, also bump the serial number.
unpackConfigResult :: ClockTime -> ConfigState
                      -> (a, ConfigState) -> ((a, Bool, Bool), ConfigState)
unpackConfigResult now cs (r, cs')
                     | cs /= cs' = ( (r, True, needsFullDist cs cs')
                                   , over csConfigDataL (bumpSerial now) cs'
                                   )
                     | otherwise = ((r, False, False), cs')
unpackConfigResult :: ClockTime -> ConfigState
                      -> (a, ConfigState) -> ((a, Bool, Bool), ConfigState)
unpackConfigResult now cs (r, cs')
                     | cs /= cs' = ( (r, True, needsFullDist cs cs')
                                   , over csConfigDataL (bumpSerial now) cs'
                                   )
                     | otherwise = ((r, False, False), cs')
unpackConfigResult now cs (r, cs')
                     | cs /= cs' = ( (r, True, needsFullDist cs cs')
                                   , over csConfigDataL (bumpSerial now) cs'
                                   )
                     | otherwise = ((r, False, False), cs')