runOpArgs :: WorkerOp -> Put -> MonadStore ()
runOpArgs op args = do

  -- Temporary hack for printing the messages destined for nix-daemon socket
  when False $
    liftIO $ LBS.writeFile "mytestfile2" $ runPut $ do
      putInt $ opNum op
      args

  sockPut $ do
    putInt $ opNum op
    args

  out <- processOutput
  modify (++out)
  err <- gotError
  when err $ do
    Error _num msg <- head <$> getError
    throwError $ BSC.unpack $ LBS.toStrict msg
runOpArgs :: WorkerOp -> Put -> MonadStore ()
runOpArgs op args = do

  -- Temporary hack for printing the messages destined for nix-daemon socket
  when False $
    liftIO $ LBS.writeFile "mytestfile2" $ runPut $ do
      putInt $ opNum op
      args

  sockPut $ do
    putInt $ opNum op
    args

  out <- processOutput
  modify (++out)
  err <- gotError
  when err $ do
    Error _num msg <- head <$> getError
    throwError $ BSC.unpack $ LBS.toStrict msg
runOpArgs op args = do

  -- Temporary hack for printing the messages destined for nix-daemon socket
  when False $
    liftIO $ LBS.writeFile "mytestfile2" $ runPut $ do
      putInt $ opNum op
      args

  sockPut $ do
    putInt $ opNum op
    args

  out <- processOutput
  modify (++out)
  err <- gotError
  when err $ do
    Error _num msg <- head <$> getError
    throwError $ BSC.unpack $ LBS.toStrict msg