hlint suggestions
This commit is contained in:
parent
c88d2d5094
commit
409cb38385
|
@ -1,3 +1,25 @@
|
||||||
|
{-|
|
||||||
|
|
||||||
|
Module : Application
|
||||||
|
Copyright : Jonathan Lamothe
|
||||||
|
License : GPL-3
|
||||||
|
Maintainer : jonathan@jlamothe.net
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or (at
|
||||||
|
your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
-}
|
||||||
|
|
||||||
{-# LANGUAGE NoImplicitPrelude #-}
|
{-# LANGUAGE NoImplicitPrelude #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
@ -104,10 +126,7 @@ warpSettings foundation =
|
||||||
-- | For yesod devel, return the Warp settings and WAI Application.
|
-- | For yesod devel, return the Warp settings and WAI Application.
|
||||||
getApplicationDev :: IO (Settings, Application)
|
getApplicationDev :: IO (Settings, Application)
|
||||||
getApplicationDev = do
|
getApplicationDev = do
|
||||||
settings <- getAppSettings
|
(_, wsettings, app) <- getSettings
|
||||||
foundation <- makeFoundation settings
|
|
||||||
wsettings <- getDevSettings $ warpSettings foundation
|
|
||||||
app <- makeApplication foundation
|
|
||||||
return (wsettings, app)
|
return (wsettings, app)
|
||||||
|
|
||||||
getAppSettings :: IO AppSettings
|
getAppSettings :: IO AppSettings
|
||||||
|
@ -143,10 +162,7 @@ appMain = do
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
getApplicationRepl :: IO (Int, App, Application)
|
getApplicationRepl :: IO (Int, App, Application)
|
||||||
getApplicationRepl = do
|
getApplicationRepl = do
|
||||||
settings <- getAppSettings
|
(foundation, wsettings, app1) <- getSettings
|
||||||
foundation <- makeFoundation settings
|
|
||||||
wsettings <- getDevSettings $ warpSettings foundation
|
|
||||||
app1 <- makeApplication foundation
|
|
||||||
return (getPort wsettings, foundation, app1)
|
return (getPort wsettings, foundation, app1)
|
||||||
|
|
||||||
shutdownApp :: App -> IO ()
|
shutdownApp :: App -> IO ()
|
||||||
|
@ -160,3 +176,13 @@ shutdownApp _ = return ()
|
||||||
-- | Run a handler
|
-- | Run a handler
|
||||||
handler :: Handler a -> IO a
|
handler :: Handler a -> IO a
|
||||||
handler h = getAppSettings >>= makeFoundation >>= flip unsafeHandler h
|
handler h = getAppSettings >>= makeFoundation >>= flip unsafeHandler h
|
||||||
|
|
||||||
|
getSettings :: IO (App, Settings, Application)
|
||||||
|
getSettings = do
|
||||||
|
settings <- getAppSettings
|
||||||
|
foundation <- makeFoundation settings
|
||||||
|
wsettings <- getDevSettings $ warpSettings foundation
|
||||||
|
app <- makeApplication foundation
|
||||||
|
return (foundation, wsettings, app)
|
||||||
|
|
||||||
|
--jl
|
||||||
|
|
|
@ -1,4 +1,24 @@
|
||||||
{-# LANGUAGE QuasiQuotes #-}
|
{-
|
||||||
|
|
||||||
|
dmfix
|
||||||
|
|
||||||
|
Copyright (C) Jonathan Lamothe <jonathan@jlamothe.net>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or (at
|
||||||
|
your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
-}
|
||||||
|
|
||||||
{-# LANGUAGE NoImplicitPrelude #-}
|
{-# LANGUAGE NoImplicitPrelude #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
module TestImport
|
module TestImport
|
||||||
|
@ -29,3 +49,5 @@ withApp = before $ do
|
||||||
foundation <- makeFoundation settings
|
foundation <- makeFoundation settings
|
||||||
logWare <- liftIO $ makeLogWare foundation
|
logWare <- liftIO $ makeLogWare foundation
|
||||||
return (foundation, logWare)
|
return (foundation, logWare)
|
||||||
|
|
||||||
|
--jl
|
||||||
|
|
Loading…
Reference in New Issue
Block a user