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


-- | Creation of type-safe, RESTful web applications.
--   
--   A RESTful web framework with strong compile-time guarantees of
--   correctness. It also affords space efficient code, highly concurrent
--   loads, and portability to many deployment backends (via the wai
--   package), from CGI to stand-alone serving.
--   
--   Yesod also focuses on developer productivity. Yesod integrates well
--   with tools for all your basic web development (wai, persistent, and
--   shakespeare/hamlet)
--   
--   The Yesod documentation site <a>http://www.yesodweb.com/</a> has much
--   more information, including on the supporting packages mentioned
--   above.
@package yesod
@version 1.2.6.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 Default WidgetFileSettings

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)
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 Read DefaultEnv
instance Show DefaultEnv
instance Enum DefaultEnv
instance Bounded DefaultEnv
instance Show env => Show (ArgConfig env)
instance (Show environment, Show extra) => Show (AppConfig environment extra)

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
