-- 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
--   <a>http://www.stackage.org/package/yesod</a>
@package yesod
@version 1.4.2.1

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


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

-- | An implementation of <a>addStaticContent</a> 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 -> HandlerT master IO (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


-- | Some next-gen helper functions for the scaffolding's configuration
--   system.
module Yesod.Default.Config2
newtype MergedValue
MergedValue :: Value -> MergedValue
[getMergedValue] :: MergedValue -> Value
applyCurrentEnv :: Bool -> Value -> IO Value
getCurrentEnv :: IO (HashMap Text Text)
applyEnvValue :: Bool -> HashMap Text Text -> Value -> Value

-- | Load the settings from the following three sources:
--   
--   <ul>
--   <li>Run time config files</li>
--   <li>Run time environment variables</li>
--   <li>The default compile time config file</li>
--   </ul>
loadAppSettings :: FromJSON settings => [FilePath] -> [Value] -> EnvUsage -> IO settings

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

-- | 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 ()
makeYesodLogger :: LoggerSet -> IO Logger
data EnvUsage
ignoreEnv :: EnvUsage
useEnv :: EnvUsage
requireEnv :: EnvUsage
useCustomEnv :: HashMap Text Text -> EnvUsage
requireCustomEnv :: HashMap Text Text -> EnvUsage
instance Data.Semigroup.Semigroup Yesod.Default.Config2.MergedValue

module Yesod.Default.Config

-- | A yesod-provided <tt><tt>AppEnv</tt></tt>, 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 <tt><a>DefaultEnv</a></tt>)
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 <a>DefaultEnv</a> 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 <tt><a>AppConfig</a></tt>.
--   
--   Some examples:
--   
--   <pre>
--   -- typical local development
--   Development:
--     host: localhost
--     port: 3000
--   
--     -- approot: will default to ""
--   </pre>
--   
--   <pre>
--   -- 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"
--   </pre>
--   
--   <pre>
--   -- maybe you're reverse proxying connections to the running app
--   -- on some other port
--   Production:
--     port: 8080
--     approot: "http://example.com"
--     host: "localhost"
--   </pre>
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
--   <tt>Nothing</tt>.
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

module Yesod.Default.Main

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

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

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

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


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