Skip to content

Effect system integrations #4

@cdsmith

Description

@cdsmith

Migrated from TODO file.

There are a lot of libraries in Haskell that can be used to define an API to some external system. Ideally, there would be a way to mock all of these with HMock. This includes:

  • Effect systems like polysemy, fused-effects, freer-simple, and eff.
  • API layers, like haxl and servant

This needs some serious thought about how to separate mtl-isms from the more reusable core of HMock, so that as much as reasonable can be shared with other systems. I suppose the right way to go about this is to take a few examples, ask how you'd reimplement HMock for that specific system, and then look for the right refactorings to share the common bits. The HMock core expectation language, surface expectation language, and most of the MockableBase class should hopefully be shared.

Many of these systems already have their own action types, which could be trivially wrapped rather than deriving a new Action class. This might mean that Action should be an injective type family rather than a data family. However, we might need to lose some type safety for this to occur, since the method name isn't encoded into the type any longer. This definitely might interfere with any type tricks of the sort I'm contemplating to implement polymorphic return values, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions