From 98af698a806e41904368c0114f9d8d9f377d9c09 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 27 Dec 2024 17:54:31 +0530 Subject: Minor refactor --- src/Chelleport/AppState.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Chelleport/AppState.hs') 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 -- cgit v1.3.1