aboutsummaryrefslogtreecommitdiff
path: root/src/Chelleport/AppState.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-27 17:54:31 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-27 17:54:31 +0530
commit98af698a806e41904368c0114f9d8d9f377d9c09 (patch)
treeb09e835b1cf4c678fe557b1ab01905e75ee3922f /src/Chelleport/AppState.hs
parent3d461b234d0b30cb7085251390b264089f447a97 (diff)
downloadchelleport-98af698a806e41904368c0114f9d8d9f377d9c09.tar.gz
chelleport-98af698a806e41904368c0114f9d8d9f377d9c09.zip
Minor refactor
Diffstat (limited to 'src/Chelleport/AppState.hs')
-rw-r--r--src/Chelleport/AppState.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Chelleport/AppState.hs b/src/Chelleport/AppState.hs
index 72a1afe..8c7bac1 100644
--- a/src/Chelleport/AppState.hs
+++ b/src/Chelleport/AppState.hs
@@ -9,13 +9,12 @@ import Chelleport.Types
import Chelleport.Utils (cIntToInt, clamp, intToCInt, isEmpty, itemAt)
import Control.Monad (replicateM_)
import Data.Char (toLower)
-import Data.List (isInfixOf)
-import Data.Maybe (fromMaybe, isJust)
+import Data.Maybe (isJust)
import qualified Text.Fuzzy as Fuzzy
initialState :: (Monad m) => m (State, Maybe AppAction)
initialState = do
- let cells = fromMaybe (pure undefined) $ generateGrid 0 (rows, columns) hintKeys
+ let cells = either error id $ generateGrid 0 (rows, columns) hintKeys
pure (defaultAppState {stateGrid = cells}, Just $ SetMode defaultHintsMode)
where
rows = 9