From a872fcfd6c9a72ce3d5c4d554b076b938ffd586d Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Tue, 10 Sep 2024 19:03:19 -0400 Subject: [PATCH] added password database to `AppState` --- src/Password/App/Types.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Password/App/Types.hs b/src/Password/App/Types.hs index 1087c0e..91b8343 100644 --- a/src/Password/App/Types.hs +++ b/src/Password/App/Types.hs @@ -33,6 +33,7 @@ module Password.App.Types ( -- * Lenses -- ** AppState randGen, + database, appMode, -- ** AppMode initState, @@ -51,11 +52,16 @@ import Lens.Micro (_1, _2) import Lens.Micro.TH (makeLenses) import System.Random (StdGen, initStdGen) +import Password + -- | The application state data AppState = AppState { _randGen :: StdGen -- ^ The random number generator + , _database :: PWDatabase + -- ^ The password database , _appMode :: AppMode + -- ^ The current operating mode } -- | The applicaiton's mode @@ -88,6 +94,7 @@ concat <$> mapM makeLenses mkInitialState :: MonadIO m => m AppState mkInitialState = AppState <$> initStdGen + <*> return newPWDatabase <*> return (InitMode newInitState) -- | New `InitState` value