Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide MonadTraceMVar #18

Open
coot opened this issue Aug 18, 2022 · 0 comments
Open

Provide MonadTraceMVar #18

coot opened this issue Aug 18, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@coot
Copy link
Collaborator

coot commented Aug 18, 2022

First provide MonadInspectMVar which is the analogy of MonadInspectSTM but for MVars.

class ( MonadMVar m
      , Monad (InspectMonadMVar m)
      )
    => MonadInspectMVar m where
    type InspectMonadMVar m :: Type -> Type
    inspectMVar :: proxy m -> MVar m a -> InspectMonadMVar m (Maybe a)

Then provide a type class

class MonadTraceMVar m where
  traceMVarIO :: proxy 
              -> MVar m a
              -> (Maybe (Maybe a) -> Maybe a -> InspectMonad m TraceValue)
              -> m ()

and two instances: MonadTraceMVar IO and MonadTraceMVar (IOSim s).

Under this proposal, I also suggest we also rename the associated type family InspectMonad of MonadInspectSTM as InsepctMonadSTM.

@coot coot added the enhancement New feature or request label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: No status
Development

No branches or pull requests

1 participant