make lenses for AppState
This commit is contained in:
parent
76d2600fcf
commit
a3f405d9c5
|
@ -22,12 +22,16 @@ License along with this program. If not, see
|
||||||
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
|
||||||
module Password.App.Types (
|
module Password.App.Types (
|
||||||
AppState (..),
|
AppState (..),
|
||||||
|
randGen,
|
||||||
mkInitialState
|
mkInitialState
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad.IO.Class (MonadIO)
|
import Control.Monad.IO.Class (MonadIO)
|
||||||
|
import Lens.Micro.TH
|
||||||
import System.Random (StdGen, initStdGen)
|
import System.Random (StdGen, initStdGen)
|
||||||
|
|
||||||
-- | The application state
|
-- | The application state
|
||||||
|
@ -36,6 +40,8 @@ newtype AppState = AppState
|
||||||
-- ^ The random number generator
|
-- ^ The random number generator
|
||||||
} deriving (Eq, Show)
|
} deriving (Eq, Show)
|
||||||
|
|
||||||
|
makeLenses ''AppState
|
||||||
|
|
||||||
-- | Builds an initial state
|
-- | Builds an initial state
|
||||||
mkInitialState :: MonadIO m => m AppState
|
mkInitialState :: MonadIO m => m AppState
|
||||||
mkInitialState = AppState <$> initStdGen
|
mkInitialState = AppState <$> initStdGen
|
||||||
|
|
Loading…
Reference in New Issue
Block a user