-- | Read a PVar as part of a transaction.
readPVar :: PVar a -> VTx a
readPVar pvar = 
    getVTxSpace >>= \ space ->
    if (space /= pvar_space pvar) then fail eBadSpace else
    liftSTM $ readTVar (pvar_data pvar) >>= \ rdv ->
              case rdv of { (RDV v) -> return v }
readPVar :: PVar a -> VTx a
readPVar pvar = 
    getVTxSpace >>= \ space ->
    if (space /= pvar_space pvar) then fail eBadSpace else
    liftSTM $ readTVar (pvar_data pvar) >>= \ rdv ->
              case rdv of { (RDV v) -> return v }
readPVar pvar = 
    getVTxSpace >>= \ space ->
    if (space /= pvar_space pvar) then fail eBadSpace else
    liftSTM $ readTVar (pvar_data pvar) >>= \ rdv ->
              case rdv of { (RDV v) -> return v }