lensify AppState

This commit is contained in:
2024-07-18 19:06:17 -04:00
parent 696b17fae1
commit 21242ecbfa
3 changed files with 15 additions and 2 deletions

View File

@@ -24,15 +24,24 @@ License along with this program. If not, see
|-}
module Hamming.App.Types (AppState (..), initialState) where
{-# LANGUAGE TemplateHaskell #-}
module Hamming.App.Types (
AppState (..),
hammingCode,
initialState
) where
import Data.Word (Word16)
import Lens.Micro.TH (makeLenses)
-- | The main state of the application
data AppState = AppState
{ hammingCode :: Word16
{ _hammingCode :: Word16
}
makeLenses ''AppState
-- | Initial application state
initialState :: AppState
initialState = AppState 0