on master help sign in
2 files changed+7−2
since splitsnapshots
unifiedsplit
libyaml/src/Text/Libyaml.hs+1−1 yaml/src/Data/Yaml/Config.hs+6−1
libyaml/src/Text/Libyaml.hs+1−1
@@ -776,7 +776,7 @@ encodeWith opts =
776776 close _ fbuf = withForeignPtr fbuf $ \b -> do
777777 ptr' <- c_get_buffer_buff b
778778 len <- c_get_buffer_used b
779− fptr <- newForeignPtr_ $ castPtr ptr'
779+ fptr <- newForeignPtr finalizerFree $ castPtr ptr'
780780 return $ B.fromForeignPtr fptr 0 $ fromIntegral len
781781
782782
yaml/src/Data/Yaml/Config.hs+6−1
@@ -5,7 +5,7 @@
55-- In particular, merging environment variables with yaml values
66--
77-- 'loadYamlSettings' is a high-level API for loading YAML and merging environment variables.
8−-- A yaml value of @_env:ENV_VAR:default@ will lookup the environment variable @ENV_VAR@.
8+-- A yaml value of @_env:ENV_VAR:default@ or just @_env:ENV_VAR@ will lookup the environment variable @ENV_VAR@.
99--
1010-- On a historical note, this code was taken directly from the yesod web framework's configuration module.
1111module Data.Yaml.Config
@@ -185,6 +185,11 @@ requireCustomEnv = RequireCustomEnv
185185--
186186-- > loadYamlSettings ["config/foo.yaml"] [] useEnv
187187--
188+-- Alternatively you can configure settings through the Yaml @Value@ directly in Haskell.
189+-- For example, to load up settings from only from environment variables, you can use:
190+--
191+-- > loadYamlSettings [] [object ["connectionString" .= ("_env:DATABASE_URL" :: String)]] requireEnv
192+--
188193-- @since 0.8.16
189194loadYamlSettings
190195 :: FromJSON settings