implemented addChar and removeChar

This commit is contained in:
Jonathan Lamothe
2019-08-24 17:01:18 -04:00
parent 3cc76d881c
commit 054289e3d6
2 changed files with 31 additions and 2 deletions

View File

@@ -19,6 +19,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
-}
{-# LANGUAGE LambdaCase #-}
module Mtlstats.Actions
( startNewSeason
, resetYtd
@@ -49,8 +51,10 @@ startNewGame
-- | Adds a character to the input buffer
addChar :: Char -> ProgState -> ProgState
addChar = undefined
addChar c = inputBuffer %~ (++[c])
-- | Removes a character from the input buffer (if possible)
removeChar :: ProgState -> ProgState
removeChar = undefined
removeChar = inputBuffer %~ \case
"" -> ""
str -> init str