[scaffold] use if-then-else instead of guards
While the guards solution was nice, it causes GHC to emit a non-exhaustive pattern warning.
This commit is contained in:
parent
7ce991d9cb
commit
1b9b19bb64
@ -33,9 +33,9 @@ makeApplication conf logger = do
|
|||||||
app <- toWaiAppPlain foundation
|
app <- toWaiAppPlain foundation
|
||||||
return $ logWare app
|
return $ logWare app
|
||||||
where
|
where
|
||||||
(logWare, setLogger)
|
setLogger = if development then logger else toProduction logger
|
||||||
| development = (logCallbackDev (logBS setLogger), logger)
|
logWare = if development then logCallbackDev (logBS setLogger)
|
||||||
| production = (logCallback (logBS setLogger), toProduction logger)
|
else logCallback (logBS setLogger)
|
||||||
|
|
||||||
makeFoundation :: AppConfig DefaultEnv Extra -> Logger -> IO ~sitearg~
|
makeFoundation :: AppConfig DefaultEnv Extra -> Logger -> IO ~sitearg~
|
||||||
makeFoundation conf setLogger = do
|
makeFoundation conf setLogger = do
|
||||||
|
|||||||
@ -54,9 +54,8 @@ staticRoot conf = [st|#{appRoot conf}/static|]
|
|||||||
-- user.
|
-- user.
|
||||||
|
|
||||||
widgetFile :: String -> Q Exp
|
widgetFile :: String -> Q Exp
|
||||||
widgetFile
|
widgetFile = if development then Yesod.Default.Util.widgetFileReload
|
||||||
| development = Yesod.Default.Util.widgetFileReload
|
else Yesod.Default.Util.widgetFileNoReload
|
||||||
| production = Yesod.Default.Util.widgetFileNoReload
|
|
||||||
|
|
||||||
data Extra = Extra
|
data Extra = Extra
|
||||||
{ extraCopyright :: Text
|
{ extraCopyright :: Text
|
||||||
|
|||||||
@ -8,9 +8,8 @@ import Settings.Development
|
|||||||
|
|
||||||
-- | use this to create your static file serving site
|
-- | use this to create your static file serving site
|
||||||
staticSite :: IO Static.Static
|
staticSite :: IO Static.Static
|
||||||
staticSite
|
staticSite = if development then Static.staticDevel staticDir
|
||||||
| development = Static.staticDevel staticDir
|
else Static.static staticDir
|
||||||
| production = Static.static staticDir
|
|
||||||
|
|
||||||
-- | This generates easy references to files in the static directory at compile time,
|
-- | This generates easy references to files in the static directory at compile time,
|
||||||
-- giving you compile-time verification that referenced files exist.
|
-- giving you compile-time verification that referenced files exist.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user