web: Fix compilation errors for all 'stack.yaml's
This commit is contained in:
		
							parent
							
								
									8d1ee38627
								
							
						
					
					
						commit
						466558968b
					
				| @ -21,7 +21,7 @@ import qualified Data.ByteString.Char8 as BC | |||||||
| import Data.Traversable (for) | import Data.Traversable (for) | ||||||
| import Data.IORef (IORef, readIORef, writeIORef) | import Data.IORef (IORef, readIORef, writeIORef) | ||||||
| import Data.Maybe (fromMaybe) | import Data.Maybe (fromMaybe) | ||||||
| import Data.Semigroup ((<>)) | import Data.Monoid ((<>)) | ||||||
| import Data.Text (Text) | import Data.Text (Text) | ||||||
| import qualified Data.Text as T | import qualified Data.Text as T | ||||||
| import Data.Time.Calendar (Day) | import Data.Time.Calendar (Day) | ||||||
|  | |||||||
| @ -13,7 +13,7 @@ import           Data.ByteString      as Import (ByteString) | |||||||
| import           Data.Default         as Import | import           Data.Default         as Import | ||||||
| import           Data.Either          as Import | import           Data.Either          as Import | ||||||
| import           Data.Foldable        as Import | import           Data.Foldable        as Import | ||||||
| import           Data.List            as Import (foldl', unfoldr) | import           Data.List            as Import (unfoldr) | ||||||
| import           Data.Maybe           as Import | import           Data.Maybe           as Import | ||||||
| import           Data.Text            as Import (Text) | import           Data.Text            as Import (Text) | ||||||
| import           Data.Time            as Import hiding (parseTime) | import           Data.Time            as Import hiding (parseTime) | ||||||
|  | |||||||
| @ -25,7 +25,6 @@ import Yesod.Default.Main (defaultDevelApp) | |||||||
| 
 | 
 | ||||||
| import Hledger | import Hledger | ||||||
| import Hledger.Cli hiding (progname,prognameandversion) | import Hledger.Cli hiding (progname,prognameandversion) | ||||||
| import Hledger.Cli.Utils (journalTransform) |  | ||||||
| import Hledger.Utils.UTF8IOCompat (putStrLn) | import Hledger.Utils.UTF8IOCompat (putStrLn) | ||||||
| import Hledger.Web.Application (makeApplication) | import Hledger.Web.Application (makeApplication) | ||||||
| import Hledger.Web.Settings (Extra(..), parseExtra) | import Hledger.Web.Settings (Extra(..), parseExtra) | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
|  | {-# LANGUAGE CPP #-} | ||||||
| {-# LANGUAGE FlexibleContexts #-} | {-# LANGUAGE FlexibleContexts #-} | ||||||
| {-# LANGUAGE GADTs #-} | {-# LANGUAGE GADTs #-} | ||||||
| {-# LANGUAGE OverloadedStrings #-} | {-# LANGUAGE OverloadedStrings #-} | ||||||
| @ -26,12 +27,14 @@ import Yesod | |||||||
| import Hledger | import Hledger | ||||||
| import Hledger.Web.Settings (widgetFile) | import Hledger.Web.Settings (widgetFile) | ||||||
| 
 | 
 | ||||||
| -- XXX <select> which journal to add to |  | ||||||
| 
 |  | ||||||
| addModal :: | addModal :: | ||||||
|      ( MonadWidget m |      ( MonadWidget m | ||||||
|      , r ~ Route (HandlerSite m) |      , r ~ Route (HandlerSite m) | ||||||
|  | #if MIN_VERSION_yesod(1,6,0) | ||||||
|      , m ~ WidgetFor (HandlerSite m) |      , m ~ WidgetFor (HandlerSite m) | ||||||
|  | #else | ||||||
|  |      , m ~ WidgetT (HandlerSite m) IO | ||||||
|  | #endif | ||||||
|      , RenderMessage (HandlerSite m) FormMessage |      , RenderMessage (HandlerSite m) FormMessage | ||||||
|      ) |      ) | ||||||
|   => r -> Journal -> Day -> m () |   => r -> Journal -> Day -> m () | ||||||
| @ -54,7 +57,11 @@ addForm :: | |||||||
|   => Journal |   => Journal | ||||||
|   -> Day |   -> Day | ||||||
|   -> Markup |   -> Markup | ||||||
|  | #if MIN_VERSION_yesod(1,6,0) | ||||||
|   -> MForm m (FormResult Transaction, WidgetFor site ()) |   -> MForm m (FormResult Transaction, WidgetFor site ()) | ||||||
|  | #else | ||||||
|  |   -> MForm m (FormResult Transaction, WidgetT site IO ()) | ||||||
|  | #endif | ||||||
| addForm j today = identifyForm "add" $ \extra -> do | addForm j today = identifyForm "add" $ \extra -> do | ||||||
|   (dateRes, dateView) <- mreq dateField dateFS Nothing |   (dateRes, dateView) <- mreq dateField dateFS Nothing | ||||||
|   (descRes, descView) <- mreq textField descFS Nothing |   (descRes, descView) <- mreq textField descFS Nothing | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
|  | {-# LANGUAGE CPP #-} | ||||||
| {-# LANGUAGE LambdaCase #-} | {-# LANGUAGE LambdaCase #-} | ||||||
| {-# LANGUAGE NamedFieldPuns #-} | {-# LANGUAGE NamedFieldPuns #-} | ||||||
| {-# LANGUAGE OverloadedStrings #-} | {-# LANGUAGE OverloadedStrings #-} | ||||||
| @ -32,16 +33,20 @@ import Hledger | |||||||
| import Hledger.Cli.Utils (writeFileWithBackupIfChanged) | import Hledger.Cli.Utils (writeFileWithBackupIfChanged) | ||||||
| import Hledger.Web.Settings (manualurl) | import Hledger.Web.Settings (manualurl) | ||||||
| 
 | 
 | ||||||
|  | #if MIN_VERSION_yesod(1,6,0) | ||||||
| journalFile404 :: FilePath -> Journal -> HandlerFor m (FilePath, Text) | journalFile404 :: FilePath -> Journal -> HandlerFor m (FilePath, Text) | ||||||
|  | #else | ||||||
|  | journalFile404 :: FilePath -> Journal -> HandlerT m IO (FilePath, Text) | ||||||
|  | #endif | ||||||
| journalFile404 f j = | journalFile404 f j = | ||||||
|   case find ((== f) . fst) (jfiles j) of |   case find ((== f) . fst) (jfiles j) of | ||||||
|     Just (_, txt) -> pure (takeFileName f, txt) |     Just (_, txt) -> pure (takeFileName f, txt) | ||||||
|     Nothing -> notFound |     Nothing -> notFound | ||||||
| 
 | 
 | ||||||
| fromFormSuccess :: HandlerFor m a -> FormResult a -> HandlerFor m a | fromFormSuccess :: Applicative m => m a -> FormResult a -> m a | ||||||
| fromFormSuccess h FormMissing = h | fromFormSuccess h FormMissing = h | ||||||
| fromFormSuccess h (FormFailure _) = h | fromFormSuccess h (FormFailure _) = h | ||||||
| fromFormSuccess _ (FormSuccess a) = return a | fromFormSuccess _ (FormSuccess a) = pure a | ||||||
| 
 | 
 | ||||||
| writeValidJournal :: MonadHandler m => FilePath -> Text -> m (Either String ()) | writeValidJournal :: MonadHandler m => FilePath -> Text -> m (Either String ()) | ||||||
| writeValidJournal f txt = | writeValidJournal f txt = | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ | |||||||
| -- | -- | ||||||
| -- see: https://github.com/sol/hpack | -- see: https://github.com/sol/hpack | ||||||
| -- | -- | ||||||
| -- hash: 830642fdd094b9838924e2e3865481d8bc65afb314152d5afafe2207c3d5a9a8 | -- hash: 541d9fc4104cd8cdcda3b38d002fbf354769af5b4f46e7b12ec1f0a70f452b12 | ||||||
| 
 | 
 | ||||||
| name:           hledger-web | name:           hledger-web | ||||||
| version:        1.9.99 | version:        1.9.99 | ||||||
| @ -136,21 +136,19 @@ library | |||||||
|       Hledger.Web.Handler.AddR |       Hledger.Web.Handler.AddR | ||||||
|       Hledger.Web.Handler.Common |       Hledger.Web.Handler.Common | ||||||
|       Hledger.Web.Handler.EditR |       Hledger.Web.Handler.EditR | ||||||
|       Hledger.Web.Handler.ImportR |  | ||||||
|       Hledger.Web.Handler.JournalR |       Hledger.Web.Handler.JournalR | ||||||
|       Hledger.Web.Handler.RegisterR |       Hledger.Web.Handler.RegisterR | ||||||
|       Hledger.Web.Handler.UploadR |       Hledger.Web.Handler.UploadR | ||||||
|       Hledger.Web.Import |       Hledger.Web.Import | ||||||
|       Hledger.Web.Main |       Hledger.Web.Main | ||||||
|       Hledger.Web.Settings |       Hledger.Web.Settings | ||||||
|       Hledger.Web.Settings.Development |  | ||||||
|       Hledger.Web.Settings.StaticFiles |       Hledger.Web.Settings.StaticFiles | ||||||
|       Hledger.Web.WebOptions |       Hledger.Web.WebOptions | ||||||
|       Hledger.Web.Widget.AddForm |       Hledger.Web.Widget.AddForm | ||||||
|       Hledger.Web.Widget.Common |       Hledger.Web.Widget.Common | ||||||
|   other-modules: |   other-modules: | ||||||
|       Paths_hledger_web |       Paths_hledger_web | ||||||
|   ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints -fwarn-tabs |   ghc-options: -Wall -fwarn-tabs | ||||||
|   cpp-options: -DVERSION="1.9.99" |   cpp-options: -DVERSION="1.9.99" | ||||||
|   build-depends: |   build-depends: | ||||||
|       HUnit |       HUnit | ||||||
| @ -174,6 +172,7 @@ library | |||||||
|     , json |     , json | ||||||
|     , megaparsec >=6.4.1 |     , megaparsec >=6.4.1 | ||||||
|     , mtl |     , mtl | ||||||
|  |     , semigroups | ||||||
|     , shakespeare >=2.0.2.2 |     , shakespeare >=2.0.2.2 | ||||||
|     , template-haskell |     , template-haskell | ||||||
|     , text >=1.2 |     , text >=1.2 | ||||||
| @ -200,10 +199,11 @@ executable hledger-web | |||||||
|       Paths_hledger_web |       Paths_hledger_web | ||||||
|   hs-source-dirs: |   hs-source-dirs: | ||||||
|       app |       app | ||||||
|   ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints -fwarn-tabs |   ghc-options: -Wall -fwarn-tabs | ||||||
|   cpp-options: -DVERSION="1.9.99" |   cpp-options: -DVERSION="1.9.99" | ||||||
|   build-depends: |   build-depends: | ||||||
|       hledger-web |       base | ||||||
|  |     , hledger-web | ||||||
|   if (flag(dev)) || (flag(library-only)) |   if (flag(dev)) || (flag(library-only)) | ||||||
|     cpp-options: -DDEVELOPMENT |     cpp-options: -DDEVELOPMENT | ||||||
|   if flag(dev) |   if flag(dev) | ||||||
| @ -223,10 +223,11 @@ test-suite test | |||||||
|       Paths_hledger_web |       Paths_hledger_web | ||||||
|   hs-source-dirs: |   hs-source-dirs: | ||||||
|       tests |       tests | ||||||
|   ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints -fwarn-tabs |   ghc-options: -Wall -fwarn-tabs | ||||||
|   cpp-options: -DVERSION="1.9.99" |   cpp-options: -DVERSION="1.9.99" | ||||||
|   build-depends: |   build-depends: | ||||||
|       hledger-web |       base | ||||||
|  |     , hledger-web | ||||||
|     , hspec |     , hspec | ||||||
|     , yesod-test |     , yesod-test | ||||||
|   if (flag(dev)) || (flag(library-only)) |   if (flag(dev)) || (flag(library-only)) | ||||||
|  | |||||||
| @ -66,11 +66,12 @@ when: | |||||||
| 
 | 
 | ||||||
| ghc-options: | ghc-options: | ||||||
| - -Wall | - -Wall | ||||||
| - -Wcompat |  | ||||||
| - -Wincomplete-uni-patterns |  | ||||||
| - -Wincomplete-record-updates |  | ||||||
| - -Wredundant-constraints |  | ||||||
| - -fwarn-tabs | - -fwarn-tabs | ||||||
|  | #XXX to be reenabled once 7.6.3 support is dropped: | ||||||
|  | #- -Wcompat | ||||||
|  | #- -Wincomplete-uni-patterns | ||||||
|  | #- -Wincomplete-record-updates | ||||||
|  | #- -Wredundant-constraints | ||||||
| 
 | 
 | ||||||
| library: | library: | ||||||
|   source-dirs: . |   source-dirs: . | ||||||
| @ -82,14 +83,12 @@ library: | |||||||
|   - Hledger.Web.Handler.AddR |   - Hledger.Web.Handler.AddR | ||||||
|   - Hledger.Web.Handler.Common |   - Hledger.Web.Handler.Common | ||||||
|   - Hledger.Web.Handler.EditR |   - Hledger.Web.Handler.EditR | ||||||
|   - Hledger.Web.Handler.ImportR |  | ||||||
|   - Hledger.Web.Handler.JournalR |   - Hledger.Web.Handler.JournalR | ||||||
|   - Hledger.Web.Handler.RegisterR |   - Hledger.Web.Handler.RegisterR | ||||||
|   - Hledger.Web.Handler.UploadR |   - Hledger.Web.Handler.UploadR | ||||||
|   - Hledger.Web.Import |   - Hledger.Web.Import | ||||||
|   - Hledger.Web.Main |   - Hledger.Web.Main | ||||||
|   - Hledger.Web.Settings |   - Hledger.Web.Settings | ||||||
|   - Hledger.Web.Settings.Development |  | ||||||
|   - Hledger.Web.Settings.StaticFiles |   - Hledger.Web.Settings.StaticFiles | ||||||
|   - Hledger.Web.WebOptions |   - Hledger.Web.WebOptions | ||||||
|   - Hledger.Web.Widget.AddForm |   - Hledger.Web.Widget.AddForm | ||||||
| @ -115,6 +114,7 @@ library: | |||||||
|   - json |   - json | ||||||
|   - megaparsec >=6.4.1 |   - megaparsec >=6.4.1 | ||||||
|   - mtl |   - mtl | ||||||
|  |   - semigroups | ||||||
|   - shakespeare >=2.0.2.2 |   - shakespeare >=2.0.2.2 | ||||||
|   - template-haskell |   - template-haskell | ||||||
|   - text >=1.2 |   - text >=1.2 | ||||||
| @ -137,6 +137,7 @@ executables: | |||||||
|     main: main.hs |     main: main.hs | ||||||
|     cpp-options: -DVERSION="1.9.99" |     cpp-options: -DVERSION="1.9.99" | ||||||
|     dependencies: |     dependencies: | ||||||
|  |     - base | ||||||
|     - hledger-web |     - hledger-web | ||||||
|     when: |     when: | ||||||
|     - condition: flag(library-only) |     - condition: flag(library-only) | ||||||
| @ -150,6 +151,7 @@ tests: | |||||||
|     main: main.hs |     main: main.hs | ||||||
|     cpp-options: -DVERSION="1.9.99" |     cpp-options: -DVERSION="1.9.99" | ||||||
|     dependencies: |     dependencies: | ||||||
|  |     - base | ||||||
|     - hledger-web |     - hledger-web | ||||||
|     - hspec |     - hspec | ||||||
|     - yesod-test |     - yesod-test | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user