Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
effectful
An easy to use, fast extensible effects library with seamless integration with the existing Haskell ecosystem.
That being said, I famously recommend against this approach (see why mocking is a bad idea and my rules for sustainable Haskell), so I think it's too bad that what I consider the sustainable alternative is not mentioned in the comparison section: not using all this indirection in the first place. I.e. you don't need a record containing saveNewUser if you only have one saveNewUser and just call it. You don't need to mock out the code that you run in production if you write an integration test that uses the same code that you run in production.
That depends on the API of the library in question. For example, there's hpqtypes-effectful that gives you a DB effect and functions that make use it can perform queries that will by default run in a single database transaction.
effectful got rid of all issues I listed (I expanded a little on it here).