Thank you for pointing out this nice registry
library. It’s pretty cool how it can automatically wire functions using their types. Unlike effect systems, this one is removing boilerplate. And if we add an argument to a function and it’s already in the registry, there’s no change to the calling code at all.
And it’s simple and monomorphic. Just replace one record-of-functions with another. Not sure it would be possible to mock the effects of current effect systems with such an ease:
-- instead of a simple
newA :: IO A -- where we can just use the "effect" A
-- effect systems have different types before
-- and after the effect instantiation
runA :: Eff (A : es) r -> Eff es r
-- or
runA :: (forall e . A e -> Eff (e :& es) r) -> Eff es r
-- even if we specify the common monad for all components,
-- threading mocked/unmocked effects will require
-- some inhumane type acrobatics, or having the same
-- "escaping"
newA :: Eff es A
Can you give some examples (links to tutorials/documentation) on how these type-directed DI frameworks look in modern OOP languages?