From 004fdb118ee319be692886535c27cc5b0f338e16 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Tue, 23 Feb 2016 08:45:03 +0000 Subject: [PATCH] Put all modules under a new Vervis module --- app/DevelMain.hs | 2 +- app/devel.hs | 2 +- app/main.hs | 4 +-- src/{ => Vervis}/Application.hs | 12 ++++----- src/{ => Vervis}/Field.hs | 4 +-- src/{ => Vervis}/Form.hs | 6 ++--- src/{ => Vervis}/Foundation.hs | 4 +-- src/{ => Vervis}/Git.hs | 2 +- src/{ => Vervis}/Handler/Common.hs | 8 ++++-- src/{ => Vervis}/Handler/Home.hs | 8 +++--- src/{ => Vervis}/Handler/Person.hs | 6 ++--- src/{ => Vervis}/Handler/Project.hs | 4 +-- src/{ => Vervis}/Handler/Util.hs | 4 +-- src/{ => Vervis}/Import.hs | 6 ++--- src/{ => Vervis}/Import/NoFoundation.hs | 10 +++---- src/{ => Vervis}/Model.hs | 2 +- src/{ => Vervis}/Settings.hs | 2 +- src/{ => Vervis}/Settings/StaticFiles.hs | 4 +-- src/{ => Vervis}/Style.hs | 2 +- vervis.cabal | 34 ++++++++++++------------ 20 files changed, 65 insertions(+), 61 deletions(-) rename src/{ => Vervis}/Application.hs (97%) rename src/{ => Vervis}/Field.hs (98%) rename src/{ => Vervis}/Form.hs (94%) rename src/{ => Vervis}/Foundation.hs (99%) rename src/{ => Vervis}/Git.hs (99%) rename src/{ => Vervis}/Handler/Common.hs (91%) rename src/{ => Vervis}/Handler/Home.hs (94%) rename src/{ => Vervis}/Handler/Person.hs (97%) rename src/{ => Vervis}/Handler/Project.hs (96%) rename src/{ => Vervis}/Handler/Util.hs (92%) rename src/{ => Vervis}/Import.hs (79%) rename src/{ => Vervis}/Import/NoFoundation.hs (74%) rename src/{ => Vervis}/Model.hs (97%) rename src/{ => Vervis}/Settings.hs (99%) rename src/{ => Vervis}/Settings/StaticFiles.hs (91%) rename src/{ => Vervis}/Style.hs (99%) diff --git a/app/DevelMain.hs b/app/DevelMain.hs index 38fe870..5dbce5e 100644 --- a/app/DevelMain.hs +++ b/app/DevelMain.hs @@ -46,7 +46,7 @@ module DevelMain where import Prelude -import Application (getApplicationRepl, shutdownApp) +import Vervis.Application (getApplicationRepl, shutdownApp) import Control.Exception (finally) import Control.Monad ((>=>)) diff --git a/app/devel.hs b/app/devel.hs index ecd76ab..0084dae 100644 --- a/app/devel.hs +++ b/app/devel.hs @@ -15,7 +15,7 @@ {-# LANGUAGE PackageImports #-} -import "vervis" Application (develMain) +import "vervis" Vervis.Application (develMain) import Prelude (IO) main :: IO () diff --git a/app/main.hs b/app/main.hs index 8c2d8c0..a2cb3dd 100644 --- a/app/main.hs +++ b/app/main.hs @@ -13,8 +13,8 @@ - . -} -import Prelude (IO) -import Application (appMain) +import Prelude (IO) +import Vervis.Application (appMain) main :: IO () main = appMain diff --git a/src/Application.hs b/src/Vervis/Application.hs similarity index 97% rename from src/Application.hs rename to src/Vervis/Application.hs index c22e211..0785200 100644 --- a/src/Application.hs +++ b/src/Vervis/Application.hs @@ -15,7 +15,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -module Application +module Vervis.Application ( getApplicationDev , appMain , develMain @@ -33,7 +33,7 @@ where import Control.Monad.Logger (liftLoc, runLoggingT) import Database.Persist.Postgresql (createPostgresqlPool, pgConnStr, pgPoolSize, runSqlPool) -import Import +import Vervis.Import import Language.Haskell.TH.Syntax (qLocation) import Network.Wai (Middleware) import Network.Wai.Handler.Warp (Settings, defaultSettings, @@ -49,10 +49,10 @@ import System.Log.FastLogger (defaultBufSize, newStdoutLoggerSet, -- Import all relevant handler modules here. -- Don't forget to add new modules to your cabal file! -import Handler.Common -import Handler.Home -import Handler.Person -import Handler.Project +import Vervis.Handler.Common +import Vervis.Handler.Home +import Vervis.Handler.Person +import Vervis.Handler.Project -- This line actually creates our YesodDispatch instance. It is the second half -- of the call to mkYesodData which occurs in Foundation.hs. Please see the diff --git a/src/Field.hs b/src/Vervis/Field.hs similarity index 98% rename from src/Field.hs rename to src/Vervis/Field.hs index f5f03b9..4329753 100644 --- a/src/Field.hs +++ b/src/Vervis/Field.hs @@ -13,13 +13,13 @@ - . -} -module Field +module Vervis.Field ( loginField , passField ) where -import Import +import Vervis.Import import Data.Char (isDigit) import Data.Char.Local (isAsciiLetter) diff --git a/src/Form.hs b/src/Vervis/Form.hs similarity index 94% rename from src/Form.hs rename to src/Vervis/Form.hs index 7ff8891..e050f99 100644 --- a/src/Form.hs +++ b/src/Vervis/Form.hs @@ -13,15 +13,15 @@ - . -} -module Form +module Vervis.Form ( PersonNew (..) , formPersonNew ) where -import Import +import Vervis.Import -import Field +import Vervis.Field data PersonNew = PersonNew { uLogin :: Text diff --git a/src/Foundation.hs b/src/Vervis/Foundation.hs similarity index 99% rename from src/Foundation.hs rename to src/Vervis/Foundation.hs index 8c5f92f..d8b69d6 100644 --- a/src/Foundation.hs +++ b/src/Vervis/Foundation.hs @@ -13,9 +13,9 @@ - . -} -module Foundation where +module Vervis.Foundation where -import Import.NoFoundation +import Vervis.Import.NoFoundation import Database.Persist.Sql (ConnectionPool, runSqlPool) import Text.Hamlet (hamletFile) import Text.Jasmine (minifym) diff --git a/src/Git.hs b/src/Vervis/Git.hs similarity index 99% rename from src/Git.hs rename to src/Vervis/Git.hs index aeb453f..009a23a 100644 --- a/src/Git.hs +++ b/src/Vervis/Git.hs @@ -17,7 +17,7 @@ {- LANGUAGE GeneralizedNewtypeDeriving #-} {- LANGUAGE DeriveGeneric #-} -module Git +module Vervis.Git ( lastChange , timeAgo ) diff --git a/src/Handler/Common.hs b/src/Vervis/Handler/Common.hs similarity index 91% rename from src/Handler/Common.hs rename to src/Vervis/Handler/Common.hs index 5bae553..d6a28a8 100644 --- a/src/Handler/Common.hs +++ b/src/Vervis/Handler/Common.hs @@ -14,10 +14,14 @@ -} -- | Common handler functions. -module Handler.Common where +module Vervis.Handler.Common + ( getFaviconR + , getRobotsR + ) +where import Data.FileEmbed (embedFile) -import Import +import Vervis.Import -- These handlers embed files in the executable at compile time to avoid a -- runtime dependency, and for efficiency. diff --git a/src/Handler/Home.hs b/src/Vervis/Handler/Home.hs similarity index 94% rename from src/Handler/Home.hs rename to src/Vervis/Handler/Home.hs index 2ae69be..617e18c 100644 --- a/src/Handler/Home.hs +++ b/src/Vervis/Handler/Home.hs @@ -13,16 +13,16 @@ - . -} -module Handler.Home +module Vervis.Handler.Home ( getHomeR ) where -import Import hiding ((==.)) +import Vervis.Import hiding ((==.)) import Database.Esqueleto -import Git -import Handler.Util (loggedIn) +import Vervis.Git +import Vervis.Handler.Util (loggedIn) getHomeR :: Handler Html getHomeR = do diff --git a/src/Handler/Person.hs b/src/Vervis/Handler/Person.hs similarity index 97% rename from src/Handler/Person.hs rename to src/Vervis/Handler/Person.hs index 6e57d63..f6292ef 100644 --- a/src/Handler/Person.hs +++ b/src/Vervis/Handler/Person.hs @@ -13,7 +13,7 @@ - . -} -module Handler.Person +module Vervis.Handler.Person ( getPeopleR , postPeopleR , getPersonNewR @@ -21,11 +21,11 @@ module Handler.Person ) where -import Import hiding ((==.)) +import Vervis.Import hiding ((==.)) --import Prelude import Database.Esqueleto hiding (isNothing) -import Form +import Vervis.Form --import Model import Text.Blaze (text) import Yesod.Auth.HashDB (setPassword) diff --git a/src/Handler/Project.hs b/src/Vervis/Handler/Project.hs similarity index 96% rename from src/Handler/Project.hs rename to src/Vervis/Handler/Project.hs index 0da4923..602f26e 100644 --- a/src/Handler/Project.hs +++ b/src/Vervis/Handler/Project.hs @@ -13,13 +13,13 @@ - . -} -module Handler.Project +module Vervis.Handler.Project ( getProjectsR , getProjectR ) where -import Import hiding ((==.)) +import Vervis.Import hiding ((==.)) --import Prelude import Text.Blaze (text) diff --git a/src/Handler/Util.hs b/src/Vervis/Handler/Util.hs similarity index 92% rename from src/Handler/Util.hs rename to src/Vervis/Handler/Util.hs index 4bfea72..cc80040 100644 --- a/src/Handler/Util.hs +++ b/src/Vervis/Handler/Util.hs @@ -13,12 +13,12 @@ - . -} -module Handler.Util +module Vervis.Handler.Util ( loggedIn ) where -import Import +import Vervis.Import loggedIn :: Handler Bool loggedIn = isJust <$> maybeAuthId diff --git a/src/Import.hs b/src/Vervis/Import.hs similarity index 79% rename from src/Import.hs rename to src/Vervis/Import.hs index c51bd51..2fc4556 100644 --- a/src/Import.hs +++ b/src/Vervis/Import.hs @@ -13,7 +13,7 @@ - . -} -module Import ( module Import ) where +module Vervis.Import ( module Import ) where -import Foundation as Import -import Import.NoFoundation as Import +import Vervis.Foundation as Import +import Vervis.Import.NoFoundation as Import diff --git a/src/Import/NoFoundation.hs b/src/Vervis/Import/NoFoundation.hs similarity index 74% rename from src/Import/NoFoundation.hs rename to src/Vervis/Import/NoFoundation.hs index 7b93393..708988f 100644 --- a/src/Import/NoFoundation.hs +++ b/src/Vervis/Import/NoFoundation.hs @@ -13,13 +13,13 @@ - . -} -module Import.NoFoundation ( module Import ) where +module Vervis.Import.NoFoundation ( module Import ) where import ClassyPrelude.Yesod as Import -import Style as Import -import Model as Import -import Settings as Import -import Settings.StaticFiles as Import +import Vervis.Style as Import +import Vervis.Model as Import +import Vervis.Settings as Import +import Vervis.Settings.StaticFiles as Import import Yesod.Auth as Import import Yesod.Core.Types as Import (loggerSet) import Yesod.Default.Config2 as Import diff --git a/src/Model.hs b/src/Vervis/Model.hs similarity index 97% rename from src/Model.hs rename to src/Vervis/Model.hs index dc3d687..c64e245 100644 --- a/src/Model.hs +++ b/src/Vervis/Model.hs @@ -15,7 +15,7 @@ {-# LANGUAGE FlexibleInstances #-} -module Model where +module Vervis.Model where import ClassyPrelude.Yesod import Database.Persist.Quasi diff --git a/src/Settings.hs b/src/Vervis/Settings.hs similarity index 99% rename from src/Settings.hs rename to src/Vervis/Settings.hs index 747b0ef..73fd400 100644 --- a/src/Settings.hs +++ b/src/Vervis/Settings.hs @@ -20,7 +20,7 @@ -- In addition, you can configure a number of different aspects of Yesod -- by overriding methods in the Yesod typeclass. That instance is -- declared in the Foundation.hs file. -module Settings where +module Vervis.Settings where import ClassyPrelude.Yesod import Control.Exception (throw) diff --git a/src/Settings/StaticFiles.hs b/src/Vervis/Settings/StaticFiles.hs similarity index 91% rename from src/Settings/StaticFiles.hs rename to src/Vervis/Settings/StaticFiles.hs index 6eccef1..f9a73d3 100644 --- a/src/Settings/StaticFiles.hs +++ b/src/Vervis/Settings/StaticFiles.hs @@ -13,9 +13,9 @@ - . -} -module Settings.StaticFiles where +module Vervis.Settings.StaticFiles where -import Settings (appStaticDir, compileTimeAppSettings) +import Vervis.Settings (appStaticDir, compileTimeAppSettings) import Yesod.Static (staticFiles) -- This generates easy references to files in the static directory at compile time, diff --git a/src/Style.hs b/src/Vervis/Style.hs similarity index 99% rename from src/Style.hs rename to src/Vervis/Style.hs index d67570c..2d5dba7 100644 --- a/src/Style.hs +++ b/src/Vervis/Style.hs @@ -15,7 +15,7 @@ -- | Style component palette for use in page templates, in particular Cassius -- files. -module Style +module Vervis.Style ( -- * Types Color () , Hue () diff --git a/vervis.cabal b/vervis.cabal index f8569fe..a755945 100644 --- a/vervis.cabal +++ b/vervis.cabal @@ -34,23 +34,23 @@ flag library-only default: False library - exposed-modules: Application - Data.Char.Local - Field - Form - Foundation - Git - Import - Import.NoFoundation - Model - Settings - Settings.StaticFiles - Handler.Common - Handler.Home - Handler.Person - Handler.Project - Handler.Util - Style + exposed-modules: Data.Char.Local + Vervis.Application + Vervis.Field + Vervis.Form + Vervis.Foundation + Vervis.Git + Vervis.Import + Vervis.Import.NoFoundation + Vervis.Model + Vervis.Settings + Vervis.Settings.StaticFiles + Vervis.Handler.Common + Vervis.Handler.Home + Vervis.Handler.Person + Vervis.Handler.Project + Vervis.Handler.Util + Vervis.Style -- other-modules: default-extensions: TemplateHaskell QuasiQuotes