-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Creation of type-safe, RESTful web applications.
--   
--   API docs and the README are available at
--   http://www.stackage.org/package/yesod
@package yesod
@version 1.6.0

-- | This module simply re-exports from other modules for your convenience.
module Yesod

module Yesod.Default.Config

-- | A yesod-provided AppEnv, allows for Development,
--   Testing, and Production environments
data DefaultEnv
Development :: DefaultEnv
Testing :: DefaultEnv
Staging :: DefaultEnv
Production :: DefaultEnv

-- | Load the app config from command line parameters
fromArgs :: (Read env, Show env, Enum env, Bounded env) => (env -> Object -> Parser extra) -> IO (AppConfig env extra)

-- | Load the app config from command line parameters, using the given
--   @ConfigSettings.
--   
--   Since 1.2.2
fromArgsSettings :: (Read env, Show env, Enum env, Bounded env) => (env -> IO (ConfigSettings env extra)) -> IO (AppConfig env extra)

-- | Load your development config (when using DefaultEnv)
loadDevelopmentConfig :: IO (AppConfig DefaultEnv ())

-- | Dynamic per-environment configuration which can be loaded at run-time
--   negating the need to recompile between environments.
data AppConfig environment extra
AppConfig :: environment -> Int -> Text -> HostPreference -> extra -> AppConfig environment extra
[appEnv] :: AppConfig environment extra -> environment
[appPort] :: AppConfig environment extra -> Int
[appRoot] :: AppConfig environment extra -> Text
[appHost] :: AppConfig environment extra -> HostPreference
[appExtra] :: AppConfig environment extra -> extra
data ConfigSettings environment extra
ConfigSettings :: environment -> (environment -> Object -> Parser extra) -> (environment -> IO FilePath) -> (environment -> Value -> IO Value) -> ConfigSettings environment extra

-- | An arbitrary value, used below, to indicate the current running
--   environment. Usually, you will use DefaultEnv for this type.
[csEnv] :: ConfigSettings environment extra -> environment

-- | Load any extra data, to be used by the application.
[csParseExtra] :: ConfigSettings environment extra -> environment -> Object -> Parser extra

-- | Return the path to the YAML config file.
[csFile] :: ConfigSettings environment extra -> environment -> IO FilePath

-- | Get the sub-object (if relevant) from the given YAML source which
--   contains the specific settings for the current environment.
[csGetObject] :: ConfigSettings environment extra -> environment -> Value -> IO Value

-- | Default config settings.
configSettings :: Show env => env -> ConfigSettings env ()

-- | Load an AppConfig.
--   
--   Some examples:
--   
--   
--   -- typical local development
--   Development:
--     host: localhost
--     port: 3000
--   
--     -- approot: will default to ""
--   
--   
--   
--   -- typical outward-facing production box
--   Production:
--     host: www.example.com
--   
--     -- port: will default 80
--     -- host: will default to "*"
--     -- approot: will default "http://www.example.com"
--   
--   
--   
--   -- maybe you're reverse proxying connections to the running app
--   -- on some other port
--   Production:
--     port: 8080
--     approot: "http://example.com"
--     host: "localhost"
--   
loadConfig :: ConfigSettings environment extra -> IO (AppConfig environment extra)

-- | Loads the configuration block in the passed file named by the passed
--   environment, yields to the passed function as a mapping.
--   
--   Errors in the case of a bad load or if your function returns
--   Nothing.
withYamlEnvironment :: Show e => FilePath -> e -> (Value -> Parser a) -> IO a
instance (GHC.Show.Show environment, GHC.Show.Show extra) => GHC.Show.Show (Yesod.Default.Config.AppConfig environment extra)
instance GHC.Show.Show env => GHC.Show.Show (Yesod.Default.Config.ArgConfig env)
instance GHC.Enum.Bounded Yesod.Default.Config.DefaultEnv
instance GHC.Enum.Enum Yesod.Default.Config.DefaultEnv
instance GHC.Show.Show Yesod.Default.Config.DefaultEnv
instance GHC.Read.Read Yesod.Default.Config.DefaultEnv

-- | Some next-gen helper functions for the scaffolding's configuration
--   system.
module Yesod.Default.Config2

-- | Location of the default config file.
configSettingsYml :: FilePath

-- | Helper for getApplicationDev in the scaffolding. Looks up PORT and
--   DISPLAY_PORT and prints appropriate messages.
getDevSettings :: Settings -> IO Settings

-- | Helper for develMain in the scaffolding.
develMainHelper :: IO (Settings, Application) -> IO ()

-- | Create a Logger value (from yesod-core) out of a
--   LoggerSet (from fast-logger).
makeYesodLogger :: LoggerSet -> IO Logger

-- | A convenience wrapper around applyEnvValue and
--   getCurrentEnv
applyCurrentEnv :: Bool -> Value -> IO Value

-- | Get the actual environment as a HashMap from Text to
--   Text.
getCurrentEnv :: IO (HashMap Text Text)

-- | Override environment variable placeholders in the given Value
--   with values from the environment.
--   
--   If the first argument is True, then all placeholders _must_
--   be provided by the actual environment. Otherwise, default values from
--   the Value will be used.
applyEnvValue :: Bool -> HashMap Text Text -> Value -> Value

-- | Load the settings from the following three sources:
--   
--   
--   
- Run time config files
--   
- Run time environment variables
--   
- The default compile time config file
--   
--   
--   For example, to load up settings from config/foo.yaml and
--   allow overriding from the actual environment, you can use:
--   
--   
--   loadYamlSettings ["config/foo.yaml"] [] useEnv
--   
loadYamlSettings :: FromJSON settings => [FilePath] -> [Value] -> EnvUsage -> IO settings

-- | Same as loadYamlSettings, but get the list of runtime config
--   files from the command line arguments.
loadYamlSettingsArgs :: FromJSON settings => [Value] -> EnvUsage -> IO settings

-- | Defines how we want to use the environment variables when loading a
--   config file. Use the smart constructors provided by this module.
data EnvUsage

-- | Do not use any environment variables, instead relying on defaults
--   values in the config file.
ignoreEnv :: EnvUsage

-- | Use environment variables when available, otherwise use defaults.
useEnv :: EnvUsage

-- | Do not use default values from the config file, but instead take all
--   overrides from the environment. If a value is missing, loading the
--   file will throw an exception.
requireEnv :: EnvUsage

-- | Same as useEnv, but instead of the actual environment, use the
--   provided HashMap as the environment.
useCustomEnv :: HashMap Text Text -> EnvUsage

-- | Same as requireEnv, but instead of the actual environment, use
--   the provided HashMap as the environment.
requireCustomEnv :: HashMap Text Text -> EnvUsage
newtype MergedValue
MergedValue :: Value -> MergedValue
[getMergedValue] :: MergedValue -> Value

-- | Load the settings from the following three sources:
--   
--   
--   
- Run time config files
--   
- Run time environment variables
--   
- The default compile time config file
--   

-- | Deprecated: Use loadYamlSettings
loadAppSettings :: FromJSON settings => [FilePath] -> [Value] -> EnvUsage -> IO settings

-- | Same as loadAppSettings, but get the list of runtime config
--   files from the command line arguments.

-- | Deprecated: Use loadYamlSettingsArgs
loadAppSettingsArgs :: FromJSON settings => [Value] -> EnvUsage -> IO settings
instance GHC.Base.Semigroup Yesod.Default.Config2.MergedValue

module Yesod.Default.Handlers
getFaviconR :: MonadHandler m => m ()
getRobotsR :: MonadHandler m => m ()

module Yesod.Default.Main

-- | Run your app, taking environment and port settings from the
--   commandline.
--   
--   fromArgs helps parse a custom configuration
--   
--   
--   main :: IO ()
--   main = defaultMain (fromArgs parseExtra) makeApplication
--   
defaultMain :: IO (AppConfig env extra) -> (AppConfig env extra -> IO Application) -> IO ()

-- | Same as defaultMain, but gets a logging function back as well
--   as an Application to install Warp exception handlers.
--   
--   Since 1.2.5
defaultMainLog :: IO (AppConfig env extra) -> (AppConfig env extra -> IO (Application, LogFunc)) -> IO ()

-- | Run your application continously, listening for SIGINT and exiting
--   when received
--   
--   
--   withYourSite :: AppConfig DefaultEnv -> Logger -> (Application -> IO a) -> IO ()
--   withYourSite conf logger f = do
--       Settings.withConnectionPool conf $ \p -> do
--           runConnectionPool (runMigration yourMigration) p
--           defaultRunner f $ YourSite conf logger p
--   
defaultRunner :: (Application -> IO ()) -> Application -> IO ()

-- | Run your development app using a custom environment type and loader
--   function
defaultDevelApp :: IO (AppConfig env extra) -> (AppConfig env extra -> IO Application) -> IO (Int, Application)
type LogFunc = Loc -> LogSource -> LogLevel -> LogStr -> IO ()

-- | Various utilities used in the scaffolded site.
module Yesod.Default.Util

-- | An implementation of addStaticContent which stores the contents
--   in an external file. Files are created in the given static folder with
--   names based on a hash of their content. This allows expiration dates
--   to be set far in the future without worry of users receiving stale
--   content.
addStaticContentExternal :: (ByteString -> Either a ByteString) -> (ByteString -> String) -> FilePath -> ([Text] -> Route master) -> Text -> Text -> ByteString -> HandlerFor master (Maybe (Either Text (Route master, [(Text, Text)])))

-- | expects a file extension for each type, e.g: hamlet lucius julius
globFile :: String -> String -> FilePath
widgetFileNoReload :: WidgetFileSettings -> FilePath -> Q Exp
widgetFileReload :: WidgetFileSettings -> FilePath -> Q Exp
data TemplateLanguage
TemplateLanguage :: Bool -> String -> (FilePath -> Q Exp) -> (FilePath -> Q Exp) -> TemplateLanguage
[tlRequiresToWidget] :: TemplateLanguage -> Bool
[tlExtension] :: TemplateLanguage -> String
[tlNoReload] :: TemplateLanguage -> FilePath -> Q Exp
[tlReload] :: TemplateLanguage -> FilePath -> Q Exp
defaultTemplateLanguages :: HamletSettings -> [TemplateLanguage]
data WidgetFileSettings
wfsLanguages :: WidgetFileSettings -> HamletSettings -> [TemplateLanguage]
wfsHamletSettings :: WidgetFileSettings -> HamletSettings
instance Data.Default.Class.Default Yesod.Default.Util.WidgetFileSettings
