@hackage provide0.1.0.0

Lightweight dependency injection / namespaced+typed implicit-ish arguments

  • Installation

  • Dependencies (4)

  • Dependents (0)

  • Package Flags

      strict
       (off by default)

      Build with options, such as -Werror, which are inconvenient for development but good for CI

In many applications, there are arguments that need to be passed deeply into call hierarchies, which can be annoying. Implicit arguments are one potential solution to this, but they have a few issues. Firstly, their names are based on strings, which can be noncomposable e.g. in the case that multiple libraries choose the same name. Secondly, the type of an implicit argument can be freely chosen wherever it is used, which is more flexibility than most libraries want. Thirdly, the semantics of implicit variables is somewhat strange with respect to let bindings, etc. This library instead supports associating an unlimited number of values with a context type. Although this context type does need to be passed down somehow into the child functions, it's only one argument, not many, and it can be passed as a type or as a Proxy value. The keys of the context are types, which libraries can provide to designate the context arguments they want.