diff --git a/src/Hamming/App/Events.hs b/src/Hamming/App/Events.hs index 9c0cd71..f665c25 100644 --- a/src/Hamming/App/Events.hs +++ b/src/Hamming/App/Events.hs @@ -24,7 +24,7 @@ License along with this program. If not, see |-} -{-# LANGUAGE LambdaCase, OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings #-} module Hamming.App.Events ( eventHandler, @@ -47,7 +47,7 @@ import Brick.Keybindings , onEvent ) import Control.Monad (void) -import Control.Monad.State.Class (get, gets, modify, put) +import Control.Monad.State.Class (gets, modify, put) import Data.Either (fromRight) import Graphics.Vty.Input.Events ( Event (EvKey) @@ -95,10 +95,7 @@ keyEventHandlers = , onEvent CheckBitsEvent "Set Check Bits" $ hammingCode %= setCheckBits , onEvent FixCodeEvent "Attempt to Correct Errors" $ - zoom hammingCode $ get >>= \case - Nothing -> return () - Just c -> put c - . correctErrors + zoom hammingCode $ gets correctErrors >>= mapM_ put , onEvent ResetEvent "Reset Code" $ hammingCode .= 0 ]