diff --git a/app/Types.hs b/app/Types.hs index 919614b..4e47896 100644 --- a/app/Types.hs +++ b/app/Types.hs @@ -24,7 +24,8 @@ License along with this program. If not, see module Types (Status (Status), gen, dbPath, masterPass, database) where -import Control.Lens (makeLenses, set, (^.)) +import Lens.Micro (set, (^.)) +import Lens.Micro.TH (makeLenses) import System.Random (RandomGen (next, split), StdGen) import Password diff --git a/app/UI.hs b/app/UI.hs index be35542..cc002e5 100644 --- a/app/UI.hs +++ b/app/UI.hs @@ -24,10 +24,11 @@ License along with this program. If not, see module UI (getMasterPass, mainMenu) where -import Control.Lens (over, set, view, (^.)) import Control.Monad (when) import Control.Monad.Trans.Class (lift) import qualified Control.Monad.Trans.State as S +import Lens.Micro (over, set, (^.)) +import Lens.Micro.Extras (view) import System.Console.HCL ( Request , prompt diff --git a/app/Util.hs b/app/Util.hs index d4b1452..78c8c1f 100644 --- a/app/Util.hs +++ b/app/Util.hs @@ -33,12 +33,13 @@ module Util , save ) where -import Control.Lens (over, view) import Control.Monad (join) import Control.Monad.Trans.Class (lift) import qualified Control.Monad.Trans.State as S import Data.Aeson (decodeFileStrict, encodeFile) import Data.Maybe (fromJust, fromMaybe) +import Lens.Micro (over) +import Lens.Micro.Extras (view) import System.Console.HCL ( Request , prompt diff --git a/package.yaml b/package.yaml index bf2cc95..1b65c03 100644 --- a/package.yaml +++ b/package.yaml @@ -24,7 +24,8 @@ dependencies: - aeson - bytestring - containers -- lens +- microlens >= 0.4.11.2 && < 0.5 +- microlens-th >= 0.4.3.6 && < 0.5 - random ghc-options: diff --git a/src/Password.hs b/src/Password.hs index 2f04866..871d10d 100644 --- a/src/Password.hs +++ b/src/Password.hs @@ -47,7 +47,6 @@ module Password ( pwHasService, pwSetService, pwGetService, pwRemoveService, pwSearch ) where -import Control.Lens (makeLenses, over, set, to, (^.)) import Data.Aeson ( FromJSON (parseJSON) , ToJSON (toJSON) @@ -67,6 +66,8 @@ import Data.Digest.Pure.SHA import qualified Data.Map as M import Data.Maybe (fromMaybe) import qualified Data.Text as T +import Lens.Micro (over, set, to, (^.)) +import Lens.Micro.TH (makeLenses) import System.Random (RandomGen, randoms, split) -- | a mapping of service names to password data diff --git a/test/Spec/NewPWData.hs b/test/Spec/NewPWData.hs index ce7db80..37c70c0 100644 --- a/test/Spec/NewPWData.hs +++ b/test/Spec/NewPWData.hs @@ -22,7 +22,7 @@ License along with this program. If not, see module Spec.NewPWData (tests) where -import Control.Lens ((^.)) +import Lens.Micro ((^.)) import System.Random (mkStdGen, StdGen) import Test.HUnit (Test (..), (~?=)) diff --git a/test/Spec/NewPWPolicy.hs b/test/Spec/NewPWPolicy.hs index 7564536..9e1b0f9 100644 --- a/test/Spec/NewPWPolicy.hs +++ b/test/Spec/NewPWPolicy.hs @@ -22,7 +22,7 @@ License along with this program. If not, see module Spec.NewPWPolicy (tests) where -import Control.Lens ((^.)) +import Lens.Micro ((^.)) import Test.HUnit (Test(..), (~?=)) import Password diff --git a/test/Spec/PWGenerate.hs b/test/Spec/PWGenerate.hs index d7d6135..41ecebd 100644 --- a/test/Spec/PWGenerate.hs +++ b/test/Spec/PWGenerate.hs @@ -22,8 +22,8 @@ License along with this program. If not, see module Spec.PWGenerate (tests) where -import Control.Lens (set, (^.)) import Data.Maybe (fromJust) +import Lens.Micro (set, (^.)) import System.Random (mkStdGen, StdGen) import Test.HUnit (Test (..) diff --git a/test/Spec/ValidatePWData.hs b/test/Spec/ValidatePWData.hs index 8cd5c73..a032c80 100644 --- a/test/Spec/ValidatePWData.hs +++ b/test/Spec/ValidatePWData.hs @@ -22,8 +22,8 @@ License along with this program. If not, see module Spec.ValidatePWData (tests) where -import Control.Lens (set) import qualified Data.ByteString.Lazy as B +import Lens.Micro (set) import System.Random (mkStdGen, StdGen) import Test.HUnit (Test (..), (~?=)) diff --git a/test/Spec/ValidatePWDatabase.hs b/test/Spec/ValidatePWDatabase.hs index d76a3ea..defe77f 100644 --- a/test/Spec/ValidatePWDatabase.hs +++ b/test/Spec/ValidatePWDatabase.hs @@ -22,8 +22,8 @@ License along with this program. If not, see module Spec.ValidatePWDatabase (tests) where -import Control.Lens (set) import qualified Data.Map as M +import Lens.Micro (set) import System.Random (mkStdGen, StdGen) import Test.HUnit (Test (..), (~?=)) diff --git a/test/Spec/ValidatePWPolicy.hs b/test/Spec/ValidatePWPolicy.hs index af3bcb2..0db761b 100644 --- a/test/Spec/ValidatePWPolicy.hs +++ b/test/Spec/ValidatePWPolicy.hs @@ -22,7 +22,7 @@ License along with this program. If not, see module Spec.ValidatePWPolicy (tests) where -import Control.Lens (set) +import Lens.Micro (set) import Test.HUnit (Test(..), (~?=)) import Password