dep-t-value: Pair resources files with types within your program.

[ bsd3, control, library ] [ Propose Tags ] [ Report a vulnerability ]

Pair resources files with types within your program.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies aeson (>=2.0.2.0), base (>=4.10.0.0 && <5), bytestring (>=0.10.12.0), containers (>=0.6.5.1), dep-t (>=0.6.1.0 && <0.7), directory (>=1.3.6.0), filepath (>=1.4.0.0), mtl (>=2.2), split (>=0.2.3), text (>=1.2.5.0), transformers (>=0.5.0.0), unliftio-core (>=0.2.0.0) [details]
License BSD-3-Clause
Author Daniel Diaz
Maintainer diaz_carrete@yahoo.com
Category Control
Source repo head: git clone https://github.com/danidiaz/dep-t-value.git
Uploaded by DanielDiazCarrete at 2022-04-17T10:08:03Z
Distributions
Downloads 103 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-04-17 [all 1 reports]

Readme for dep-t-value-0.1.0.0

[back to package description]

dep-t-value

Pair resources files with types within your program.

Part of the dep-t-framework.

How to use

  • Take a datatype that you want to associate to a resource file, and derive a Dep.Resource.FromResource instance for it.

  • Make your program logic take a Value yourdatatype record.

  • When assembling the global application environment,

    • Use dataDirLoader to define a Loader that searches for resource files by following the datatype's module path, and uses the dataype's name as file name.

    • Build the Value yourdatatype by using functions form Dep.Value.JSON or Dep.Value.Text.

The actual location of all these directories can be individually overridden at runtime using environment variables of the form pkg_name_var, where pkg_name is the name of the package with all hyphens converted into underscores, and var is either bindir, libdir, dynlibdir, datadir, libexedir or sysconfdir. For example, the configured data directory for pretty-show is controlled with the pretty_show_datadir environment variable.