News for hackers. Stuff that matters.
Re:Dependency injection is dynamic scoping in disguise by _bxg1 on Thursday October 31, 2019 @09:36AM (#21408540)
Plus, passing it via function parameters allows you to do things like currying (outside of the constructor case, I suppose)

  const foo = (env) => (arg1, arg2) => {
    ...
  }

  const fooWithEnv = foo(myEnv)
Re:Dependency injection is dynamic scoping in disguise by eru on Friday November 01, 2019 @06:19AM (#21417423)
That's what the Reader Monad does under the hood. See eg https://eli.thegreenplace.net/2018/haskell-functions-as-func...