Conferer

Conferer

  • Get Started
  • Tutorial
  • Docs

›FromConfig

Quickstart

  • Getting started

Tutorial

  • Quick tutorial
  • Multiple configs and generics

Core concepts

  • Core concepts
  • Sources
  • FromConfig

Sources

  • Basic Sources
  • Util sources
  • Json source
  • Dhall source
  • Yaml source

FromConfig

  • List FromConfig
  • File FromConfig
  • Overriding any FromConfig
  • Aeson (JSON) FromConfig
  • Warp FromConfig
  • Snap FromConfig
  • Hspec FromConfig
  • Hedis FromConfig
Edit

File FromConfig

File FromConfig

This FromConfig instance provides support for parsing values of type File, which is a newtype wrapping Filepath.

Filepath and overrides

This instance can read a filepath as a File, but if any more specific value is given that value will be used instead.

So if you have FILE_EXTENSION=jpg and cli arg --file=someFile.png, the file will be read as someFile.jpg since "file.extension" is more specific than "file". This may change in the future but that's the current behavior, if enough people find this confusing we may change it.

extension :: String

The file extension.

Example: md in docs/fromConfig/file.md.

dirname :: String

The path without the filename.

Example: docs/fromConfig in docs/fromConfig/file.md.

basename :: String

The filename without the extension.

Example: file in docs/fromConfig/file.md.

filename :: String

The filename (basename + extension).

Example: file.md in docs/fromConfig/file.md.

Last updated on 2/21/2021 by juanFdS
← List FromConfigOverriding any FromConfig →
  • File FromConfig
  • Filepath and overrides
    • extension :: String
    • dirname :: String
    • basename :: String
    • filename :: String
Conferer
Docs
Quick TutorialCore Concepts
Community
Issue tracker
More
GitHub
Follow @ludat_
Copyright © 2024 Lucas David Traverso