From Dependency injection to dependency rejection
summary
Shows a concrete restaurant-reservation example implemented in C#, F# and Haskell and claims that partial application compiles to constructor injection — the F# version decompiles to an IL class with fields and a constructor, so it behaves like DI but remains impure. Refactors the code so the core function tryAccept takes a reservation and a reservation list and returns a decision (reservation option), i.e. pure core returns a decision, and composes impure IO around it in an impure–pure–impure "sandwich". The refactoring compiles and preserves behavior.
AI-written summary · about








