From f331ebec1643baa93eacbb39c028193381f3b285 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 4 Apr 2016 17:44:29 -0700 Subject: [PATCH] ui, api: switch to the quicker-building microlens This may not make much difference since dependencies brick and servant-swagger still depend on lens, but that might change. --- hledger-api/future-package.yaml | 2 +- hledger-api/hledger-api.cabal | 2 +- hledger-api/hledger-api.hs | 8 ++++---- hledger-ui/Hledger/UI/AccountsScreen.hs | 2 +- hledger-ui/Hledger/UI/ErrorScreen.hs | 2 +- hledger-ui/Hledger/UI/Main.hs | 2 +- hledger-ui/Hledger/UI/RegisterScreen.hs | 2 +- hledger-ui/Hledger/UI/TransactionScreen.hs | 2 +- hledger-ui/Hledger/UI/UIUtils.hs | 2 +- hledger-ui/future-package.yaml | 2 +- hledger-ui/hledger-ui.cabal | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hledger-api/future-package.yaml b/hledger-api/future-package.yaml index 8b63324a8..26cb531d2 100644 --- a/hledger-api/future-package.yaml +++ b/hledger-api/future-package.yaml @@ -159,7 +159,7 @@ executables: - Decimal - docopt - either - - lens + - microlens >= 0.3.5.1 && < 0.5 - safe - servant-server - servant-swagger diff --git a/hledger-api/hledger-api.cabal b/hledger-api/hledger-api.cabal index ae8f3976a..2b9941868 100644 --- a/hledger-api/hledger-api.cabal +++ b/hledger-api/hledger-api.cabal @@ -48,7 +48,7 @@ executable hledger-api , Decimal , docopt , either - , lens + , microlens >= 0.3.5.1 && < 0.5 , safe , servant-server , servant-swagger diff --git a/hledger-api/hledger-api.hs b/hledger-api/hledger-api.hs index cc2a3a5aa..7f56184a2 100644 --- a/hledger-api/hledger-api.hs +++ b/hledger-api/hledger-api.hs @@ -11,7 +11,7 @@ module Main where -import Control.Lens ((&), (.~), (?~)) +import Lens.Micro ((&), (.~)) import Control.Monad import Data.Aeson import qualified Data.ByteString.Lazy.Char8 as BL8 @@ -64,8 +64,8 @@ swaggerSpec :: Swagger swaggerSpec = toSwagger (Proxy :: Proxy HledgerApi) & info.infoTitle .~ "hledger API" & info.infoVersion .~ pack version - & info.infoDescription ?~ "This is the API provided by hledger-api for reading hledger data" - & info.infoLicense ?~ License "GPLv3+" (Nothing) + & info.infoDescription .~ Just "This is the API provided by hledger-api for reading hledger data" + & info.infoLicense .~ Just (License "GPLv3+" (Nothing)) main :: IO () main = do @@ -196,7 +196,7 @@ instance ToSchema Decimal where schema = mempty & schemaType .~ SwaggerNumber - & schemaExample ?~ toJSON (100 :: Decimal) + & schemaExample .~ Just (toJSON (100 :: Decimal)) instance ToSchema Amount instance ToSchema AmountStyle instance ToSchema Side diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index 87c1e056b..ece951f23 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -10,7 +10,7 @@ module Hledger.UI.AccountsScreen ) where -import Control.Lens ((^.)) +import Lens.Micro ((^.)) -- import Control.Monad import Control.Monad.IO.Class (liftIO) -- import Data.Default diff --git a/hledger-ui/Hledger/UI/ErrorScreen.hs b/hledger-ui/Hledger/UI/ErrorScreen.hs index 1f8ecfa58..8a51071c7 100644 --- a/hledger-ui/Hledger/UI/ErrorScreen.hs +++ b/hledger-ui/Hledger/UI/ErrorScreen.hs @@ -6,7 +6,7 @@ module Hledger.UI.ErrorScreen (screen) where --- import Control.Lens ((^.)) +-- import Lens.Micro ((^.)) import Control.Monad.IO.Class (liftIO) import Data.Monoid -- import Data.Maybe diff --git a/hledger-ui/Hledger/UI/Main.hs b/hledger-ui/Hledger/UI/Main.hs index 7983d63ce..ab832130a 100644 --- a/hledger-ui/Hledger/UI/Main.hs +++ b/hledger-ui/Hledger/UI/Main.hs @@ -10,7 +10,7 @@ Released under GPL version 3 or later. module Hledger.UI.Main where -- import Control.Applicative --- import Control.Lens ((^.)) +-- import Lens.Micro ((^.)) import Control.Monad -- import Control.Monad.IO.Class (liftIO) -- import Data.Default diff --git a/hledger-ui/Hledger/UI/RegisterScreen.hs b/hledger-ui/Hledger/UI/RegisterScreen.hs index d91220a4e..ce5adcdb8 100644 --- a/hledger-ui/Hledger/UI/RegisterScreen.hs +++ b/hledger-ui/Hledger/UI/RegisterScreen.hs @@ -8,7 +8,7 @@ module Hledger.UI.RegisterScreen ) where -import Control.Lens ((^.)) +import Lens.Micro ((^.)) import Control.Monad.IO.Class (liftIO) import Data.List import Data.List.Split (splitOn) diff --git a/hledger-ui/Hledger/UI/TransactionScreen.hs b/hledger-ui/Hledger/UI/TransactionScreen.hs index d03d4a711..80361249b 100644 --- a/hledger-ui/Hledger/UI/TransactionScreen.hs +++ b/hledger-ui/Hledger/UI/TransactionScreen.hs @@ -7,7 +7,7 @@ module Hledger.UI.TransactionScreen ) where --- import Control.Lens ((^.)) +-- import Lens.Micro ((^.)) import Control.Monad.IO.Class (liftIO) -- import Data.List -- import Data.List.Split (splitOn) diff --git a/hledger-ui/Hledger/UI/UIUtils.hs b/hledger-ui/Hledger/UI/UIUtils.hs index b54cdbd99..01761c4ba 100644 --- a/hledger-ui/Hledger/UI/UIUtils.hs +++ b/hledger-ui/Hledger/UI/UIUtils.hs @@ -18,7 +18,7 @@ module Hledger.UI.UIUtils ( ,stToggleCleared ) where -import Control.Lens ((^.)) +import Lens.Micro ((^.)) -- import Control.Monad -- import Control.Monad.IO.Class -- import Data.Default diff --git a/hledger-ui/future-package.yaml b/hledger-ui/future-package.yaml index 058970b3a..44c7f3be1 100644 --- a/hledger-ui/future-package.yaml +++ b/hledger-ui/future-package.yaml @@ -75,7 +75,7 @@ executables: - data-default - filepath - HUnit - - lens >= 4.12.3 && < 4.14 + - microlens >= 0.3.5.1 && < 0.5 - safe >= 0.2 - split >= 0.1 && < 0.3 - transformers diff --git a/hledger-ui/hledger-ui.cabal b/hledger-ui/hledger-ui.cabal index 959a8be26..65b69d2c1 100644 --- a/hledger-ui/hledger-ui.cabal +++ b/hledger-ui/hledger-ui.cabal @@ -66,7 +66,7 @@ executable hledger-ui , data-default , filepath , HUnit - , lens >= 4.12.3 && < 4.14 + , microlens >= 0.3.5.1 && < 0.5 , safe >= 0.2 , split >= 0.1 && < 0.3 , transformers