provide: Lightweight dependency injection / namespaced+typed implicit-ish arguments
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.
Flags
Manual Flags
Name | Description | Default |
---|---|---|
strict | Build with options, such as -Werror, which are inconvenient for development but good for CI | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- provide-0.1.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0 |
---|---|
Dependencies | base (>=4.9 && <5), lens (>=5.3 && <5.4), reflection (>=2.1 && <2.2), vinyl (>=0.14 && <0.15) [details] |
License | BSD-3-Clause |
Author | Obsidian Systems LLC |
Maintainer | maintainer@obsidian.systems |
Category | Data Structures |
Uploaded | by RyanTrinkle at 2024-11-24T21:08:09Z |
Distributions | |
Downloads | 15 total (11 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs uploaded by user Build status unknown [no reports yet] |