4 ms·
You might be interested in the "free monad" approach used occasionally in scala and haskell. It separates the effectful operations from the effects by first bui
by greydius 10y ago
You might be interested in the "free monad" approach used occasionally in scala and haskell. It separates the effectful operations from the effects by first building a data structure that describes what to do and then interpreting that data structure. The key is that you can interpret the data structure in different ways. That is, one interpreter for production and another for testing. The advantage this has over mocking is that the business logic becomes a collection of pure functions.