Skip to content

Missing PropertyM callbacks for IOSimPOR #229

@MaximilianAlgehed

Description

@MaximilianAlgehed

Is your feature request related to a problem? Please describe.
The monadicIOSim callback is great, it allows you to write nice properties on top of PropertyM for IOSim. However, it runs runSimTraceST and not the IOSimPOR scheduler (for obvious reasons).

When we want to do IOSimPOR testing we have to do some spicy stuff roughly like this:

basicIOSimPOR :: Testable a => (forall s. PropertyM (IOSim s) a) -> Property
basicIOSimPOR prop = forAllBlind prop' $ \ p -> exploreSimTrace id p $ \ _ tr ->
    either (flip counterexample False . show) id $ traceResult False tr
  where
    prop' :: Gen (forall s. IOSim s Property)
    prop' = do
      Capture eval <- capture
      pure $ eval $ monadic' prop

As far as I can tell a version of this function could be in io-sim and currently isn't.

Describe the solution you'd like
A generalization of exploreSimTrace to PropertyM

Describe alternatives you've considered
Doing it by hand like above.

Are you willing to implement it?

  • Are you? 😃

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions