-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Loads environment variables from dotenv files -- -- In most applications, configuration should be separated from -- code. While it usually works well to keep configuration in the -- environment, there are cases where you may want to store configuration -- in a file outside of version control. -- -- Dotenv files have become popular for storing configuration, -- especially in development and test environments. In Ruby, -- Python and Javascript there are libraries to facilitate -- loading of configuration options from configuration files. This -- library loads configuration to environment variables for programs -- written in Haskell. -- -- To use, call loadFile from your application: -- --
--   import Configuration.Dotenv
--   loadFile False "/my/dotenvfile"
--   
-- -- This package also includes an executable that can be used to inspect -- the results of applying one or more Dotenv files to the environment, -- or for invoking your executables with an environment after one or more -- Dotenv files is applied. -- -- See the Github page for more information on this package. @package dotenv @version 0.3.4.0 module Configuration.Dotenv.ParsedVariable data ParsedVariable ParsedVariable :: VarName -> VarValue -> ParsedVariable type VarName = String data VarValue Unquoted :: VarContents -> VarValue SingleQuoted :: VarContents -> VarValue DoubleQuoted :: VarContents -> VarValue type VarContents = [VarFragment] data VarFragment VarInterpolation :: String -> VarFragment VarLiteral :: String -> VarFragment interpolateParsedVariables :: [ParsedVariable] -> IO [(String, String)] instance GHC.Classes.Eq Configuration.Dotenv.ParsedVariable.ParsedVariable instance GHC.Show.Show Configuration.Dotenv.ParsedVariable.ParsedVariable instance GHC.Classes.Eq Configuration.Dotenv.ParsedVariable.VarValue instance GHC.Show.Show Configuration.Dotenv.ParsedVariable.VarValue instance GHC.Classes.Eq Configuration.Dotenv.ParsedVariable.VarFragment instance GHC.Show.Show Configuration.Dotenv.ParsedVariable.VarFragment -- | Parser for files in dotenv format. These files generally consist of -- lines with the form key=value. Comments and blank lines are also -- supported. More information on the dotenv format can be found in the -- project README and the test suite. module Configuration.Dotenv.Parse -- | Returns a parser for a Dotenv configuration file. Accepts key and -- value arguments separated by =. Comments in all positions are -- handled appropriately. configParser :: Parser [ParsedVariable] -- | This module contains common functions to load and read dotenv files. module Configuration.Dotenv -- | Loads the given list of options into the environment. Optionally -- override existing variables with values from Dotenv files. load :: MonadIO m => Bool -> [(String, String)] -> m () -- | Loads the options in the given file to the environment. Optionally -- override existing variables with values from Dotenv files. loadFile :: MonadIO m => Bool -> FilePath -> m () -- | Parses the given dotenv file and returns values without adding -- them to the environment. parseFile :: MonadIO m => FilePath -> m [(String, String)] -- | The helper allows to avoid exceptions in the case of missing files and -- perform some action instead. onMissingFile :: MonadCatch m => m a -> m a -> m a -- | Provides a Data.Text interface for retrieving variables in a dotenv -- file. module Configuration.Dotenv.Text -- | Parses the given dotenv file and returns values without adding -- them to the environment. parseFile :: MonadIO m => FilePath -> m [(Text, Text)]