{-# LANGUAGE OverloadedStrings #-}{-# LANGUAGE CPP #-}-- | This module simply re-exports from other modules for your convenience.moduleYesod(-- * Re-exports from yesod-coremoduleYesod.Core,moduleYesod.Form,moduleYesod.Json,moduleYesod.Persist-- * Running your application,warp,warpDebug,warpEnv,develServer-- * Commonly referenced functions/datatypes,Application,liftIO,MonadBaseControl-- * Utilities,showIntegral,readIntegral-- * Hamlet library-- ** Hamlet,hamlet,xhamlet,HtmlUrl,Html,toHtml-- ** Julius,julius,JavascriptUrl,renderJavascriptUrl-- ** Cassius/Lucius,cassius,lucius,CssUrl,renderCssUrl)whereimportYesod.CoreimportText.HamletimportText.CassiusimportText.LuciusimportText.JuliusimportYesod.FormimportYesod.JsonimportYesod.PersistimportControl.Monad.IO.Class(liftIO,MonadIO(..))importControl.Monad.Trans.Control(MonadBaseControl)importNetwork.WaiimportNetwork.Wai.Middleware.RequestLogger(logStdout)importNetwork.Wai.Handler.Warp(run)importSystem.IO(stderr,hPutStrLn)importText.Blaze.Html(toHtml)importSystem.Environment(getEnv)showIntegral::Integrala=>a->StringshowIntegralx=show(fromIntegralx::Integer)readIntegral::Numa=>String->MaybeareadIntegrals=casereadssof(i,_):_->Just$fromIntegeri[]->Nothing-- | A convenience method to run an application using the Warp webserver on the-- specified port. Automatically calls 'toWaiApp'.warp::(Yesoda,YesodDispatchaa)=>Int->a->IO()warpporta=toWaiAppa>>=runport-- | Same as 'warp', but also sends a message to stdout for each request, and-- an \"application launched\" message as well. Can be useful for development.warpDebug::(Yesoda,YesodDispatchaa)=>Int->a->IO()warpDebugportapp=dohPutStrLnstderr$"Application launched, listening on port "++showportwaiApp<-toWaiAppapprunport$logStdoutwaiApp-- | Runs your application using default middlewares (i.e., via 'toWaiApp'). It-- reads port information from the PORT environment variable, as used by tools-- such as Keter.---- Note that the exact behavior of this function may be modified slightly over-- time to work correctly with external tools, without a change to the type-- signature.warpEnv::(Yesoda,YesodDispatchaa)=>a->IO()warpEnvmaster=doport<-getEnv"PORT">>=readIOapp<-toWaiAppmasterrunportapp-- | Run a development server, where your code changes are automatically-- reloaded.develServer::Int-- ^ port number->String-- ^ module name holding the code->String-- ^ name of function providing a with-application->IO()develServerportmodufunc=mapM_putStrLn["Due to issues with GHC 7.0.2, you must now run the devel server","separately. To do so, ensure you have installed the ","wai-handler-devel package >= 0.2.1 and run:",concat[" wai-handler-devel ",showport," ",modu," ",func," --yesod"],""]