Skip to content

Consider adding a dynamic effect #12

@tbidne

Description

@tbidne

Hello, thanks for the nice library.

Recently I had cause to use a dynamic variant of the typed-process effect. In particular, I had a test suite that relied on mocking, so I ended up with something like:

runTypedProcessMock :: Eff (TypedProcess : es) a -> Eff es a
runTypedProcessMock = interpret_ $ \case
  -- processConfigToCmd :: ProcessConfig i o e -> String
  ReadProcess pc -> case processConfigToCmd pc of
     "expected_cmd" -> pure (ExitSuccess, "expected output", "")
  ...

This, of course, relies on having a dynamic TypedProcess, as opposed to the static one. Do you have any interest in me upstreaming this here? The code is a straightforward translation of the static module, so I don't think it will add much of a maintenance burden. If so, I'll open a PR. If not, no worries, I'll continue to use my local implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions