removed redundant code (mostly imports)
This commit is contained in:
@@ -40,12 +40,10 @@ module Mtlstats.Actions
|
||||
) where
|
||||
|
||||
import Control.Monad.Trans.State (modify)
|
||||
import qualified Data.Map as M
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Lens.Micro (over, (^.), (&), (.~), (?~), (%~), (+~))
|
||||
import Lens.Micro ((^.), (&), (.~), (%~))
|
||||
|
||||
import Mtlstats.Types
|
||||
import Mtlstats.Util
|
||||
|
||||
-- | Starts a new season
|
||||
startNewSeason :: ProgState -> ProgState
|
||||
|
||||
@@ -25,6 +25,7 @@ module Mtlstats.Actions.NewGame.GoalieInput
|
||||
, setGameGoalie
|
||||
) where
|
||||
|
||||
import Control.Monad (void)
|
||||
import qualified Data.Map as M
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Lens.Micro ((^.), (&), (.~), (%~), (+~))
|
||||
@@ -42,10 +43,10 @@ finishGoalieEntry s = s & progMode.gameStateL.gameGoaliesRecorded
|
||||
recordGoalieStats :: ProgState -> ProgState
|
||||
recordGoalieStats s = fromMaybe s $ do
|
||||
let gs = s^.progMode.gameStateL
|
||||
gid <- gs^.gameSelectedGoalie
|
||||
goalie <- nth gid $ s^.database.dbGoalies
|
||||
mins <- gs^.gameGoalieMinsPlayed
|
||||
goals <- gs^.gameGoalsAllowed
|
||||
gid <- gs^.gameSelectedGoalie
|
||||
mins <- gs^.gameGoalieMinsPlayed
|
||||
goals <- gs^.gameGoalsAllowed
|
||||
void $ nth gid $ s^.database.dbGoalies
|
||||
|
||||
let
|
||||
gameStats = M.findWithDefault newGoalieStats gid $ gs^.gameGoalieStats
|
||||
|
||||
@@ -21,25 +21,20 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
module Mtlstats.Control (dispatch) where
|
||||
|
||||
import Control.Monad (join, when)
|
||||
import Control.Monad.Extra (ifM)
|
||||
import Control.Monad (join)
|
||||
import Control.Monad.Trans.State (gets, modify)
|
||||
import Data.Char (toUpper)
|
||||
import Data.Maybe (fromJust, fromMaybe, isJust)
|
||||
import Lens.Micro ((^.), (.~), (%~))
|
||||
import Data.Maybe (fromJust)
|
||||
import Lens.Micro ((^.))
|
||||
import Lens.Micro.Extras (view)
|
||||
import qualified UI.NCurses as C
|
||||
|
||||
import Mtlstats.Actions
|
||||
import Mtlstats.Control.EditPlayer
|
||||
import Mtlstats.Control.NewGame
|
||||
import Mtlstats.Format
|
||||
import Mtlstats.Handlers
|
||||
import Mtlstats.Menu
|
||||
import Mtlstats.Prompt
|
||||
import Mtlstats.Report
|
||||
import Mtlstats.Types
|
||||
import Mtlstats.Util
|
||||
|
||||
-- | Reads the program state and returs the apropriate controller to
|
||||
-- run
|
||||
|
||||
@@ -46,15 +46,13 @@ import Control.Monad.Extra (whenJust)
|
||||
import Control.Monad.Trans.State (gets, modify)
|
||||
import Data.Char (isDigit, toUpper)
|
||||
import Data.Foldable (forM_)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Lens.Micro ((^.), (&), (.~), (?~), (%~))
|
||||
import Lens.Micro ((^.), (&), (.~), (?~))
|
||||
import Lens.Micro.Extras (view)
|
||||
import Text.Read (readMaybe)
|
||||
import qualified UI.NCurses as C
|
||||
|
||||
import Mtlstats.Actions
|
||||
import Mtlstats.Config
|
||||
import Mtlstats.Format
|
||||
import Mtlstats.Types
|
||||
import Mtlstats.Util
|
||||
|
||||
|
||||
@@ -27,13 +27,10 @@ module Mtlstats.Prompt.NewGame.GoalieInput
|
||||
, goalsAllowedPrompt
|
||||
) where
|
||||
|
||||
import Control.Monad (when)
|
||||
import Control.Monad.Trans.State (gets, modify)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Lens.Micro ((^.), (.~), (?~))
|
||||
import Control.Monad.Trans.State (modify)
|
||||
import Lens.Micro ((?~))
|
||||
|
||||
import Mtlstats.Actions.NewGame.GoalieInput
|
||||
import Mtlstats.Config
|
||||
import Mtlstats.Prompt
|
||||
import Mtlstats.Types
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ module Mtlstats.Types.Menu (
|
||||
|
||||
import Lens.Micro ((^.))
|
||||
import Lens.Micro.TH (makeLenses)
|
||||
import qualified UI.NCurses as C
|
||||
|
||||
import Mtlstats.Types
|
||||
|
||||
|
||||
Reference in New Issue
Block a user