conferer-snap-0.1.0.1: Configuration for reading json files

Safe HaskellNone
LanguageHaskell2010

Conferer.FetchFromConfig.Snap

Contents

Synopsis

How to use this

FetchFromConfig instance for snap server configuration

import Conferer
import Conferer.FetchFromConfig.Snap () -- from package conferer-snap

main = do
  config <- defaultConfig "awesomeapp"
  snapConfig <- getFromConfig "warp" config
  • Internal utility functions | These may be useful for someone but are subject to change at any point so use with care

findKeyAndApplyConfig Source #

Arguments

:: FetchFromConfig newvalue 
=> Config

Complete config

-> Key

Key that indicates the part of the config that we care about

-> Key

Key that we use to find the config (usually concatenating with the other key)

-> (newvalue -> config -> config)

Function that knows how to use the value to update the config

-> Either Text config

Result of the last config updating

-> IO (Either Text config)

Updated config

Concatenate many transformations to the config based on keys and functions

TODO: This should probably be on conferer and maybe should use a transformer stack to avoid so much repeated code

Orphan instances

FetchFromConfig ConfigLog Source # 
Instance details

Methods

fetch :: Key -> Config -> IO (Either Text ConfigLog) #

(FetchFromConfig a, MonadSnap m) => FetchFromConfig (Config m a) Source # 
Instance details

Methods

fetch :: Key -> Config0 -> IO (Either Text (Config m a)) #