Skip to content

Harmonize MonadCont for Trace and Direct #63

@treeowl

Description

@treeowl

Direct.Par has a MonadCont instance, while Trace.Par does not. Is there a reason for this? I think either both should or neither should. If we want to add one for Trace.Par, I believe it would look like this:

instance MonadCont Par where
  callCC f = Par $ \c -> case f (\a -> Par $ \_ -> c a) of Par q -> q c

I can see both sides:

  1. If these schedulers are committed to operating in the future as they do now, then continuations are available so we might as well expose them.

  2. If GHC eventually offers more primitive support, the continuations may cease to be available, in which case the instances should go away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions