4 ms·
I use this technique to achieve bulletproof unit tests in Haskell HTTP services by providing two run functions: One that runs on IO and does all the real stuff,
by implicit 11y ago
I use this technique to achieve bulletproof unit tests in Haskell HTTP services by providing two run functions: One that runs on IO and does all the real stuff, and another that twiddles some state and produces a pure result.
This nets us tests that are 100% reliable. The compiler rejects all code that can introduce external inputs.
- JackMorgan 11y agoDo you have an example demonstrating that pattern? I'd love to see it.