[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
|
||||
return $ logWare app
|
||||
where
|
||||
(logWare, setLogger)
|
||||
| development = (logCallbackDev (logBS setLogger), logger)
|
||||
| production = (logCallback (logBS setLogger), toProduction logger)
|
||||
setLogger = if development then logger else toProduction logger
|
||||
logWare = if development then logCallbackDev (logBS setLogger)
|
||||
else logCallback (logBS setLogger)
|
||||
|
||||
makeFoundation :: AppConfig DefaultEnv Extra -> Logger -> IO ~sitearg~
|
||||
makeFoundation conf setLogger = do
|
||||
|
||||
@ -54,9 +54,8 @@ staticRoot conf = [st|#{appRoot conf}/static|]
|
||||
-- user.
|
||||
|
||||
widgetFile :: String -> Q Exp
|
||||
widgetFile
|
||||
| development = Yesod.Default.Util.widgetFileReload
|
||||
| production = Yesod.Default.Util.widgetFileNoReload
|
||||
widgetFile = if development then Yesod.Default.Util.widgetFileReload
|
||||
else Yesod.Default.Util.widgetFileNoReload
|
||||
|
||||
data Extra = Extra
|
||||
{ extraCopyright :: Text
|
||||
|
||||
@ -8,9 +8,8 @@ import Settings.Development
|
||||
|
||||
-- | use this to create your static file serving site
|
||||
staticSite :: IO Static.Static
|
||||
staticSite
|
||||
| development = Static.staticDevel staticDir
|
||||
| production = Static.static staticDir
|
||||
staticSite = if development then Static.staticDevel staticDir
|
||||
else Static.static staticDir
|
||||
|
||||
-- | This generates easy references to files in the static directory at compile time,
|
||||
-- giving you compile-time verification that referenced files exist.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user