input-output-hk / io-sim

Haskell's IO simulator which closely follows core packages (base, async, stm).
https://hackage.haskell.org/package/io-sim
Apache License 2.0
37 stars 15 forks source link

New `MonadInspectMVar` class #106

Closed jorisdral closed 1 year ago

jorisdral commented 1 year ago

Add a new MonadInspectMVar class (similar to MonadInspectSTM) with an inspectMVar function for accessing an MVar in an underlying monad (if applicable). This is mainly useful for io-sim, since the underlying monad is ST. IO has no underlying monad, so the provided instance for IO defaults inspectMVar to tryReadMVar.