wat :: IO ()
wat = print $(let playGame []     = do
                      (_, score) <- get
                      return score
                  playGame (x:xs) = do
                      (on, score) <- get
                      case x of
                           'a' | on -> put (on, score + 1)
                           'b' | on -> put (on, score - 1)
                           'c'      -> put (not on, score)
                           _        -> put (on, score)
                      playGame xs

                  startState :: (Bool, Int)
                  startState = (False, 0)
              in TH.lift (evalState (playGame "abcaaacbbcabbab") startState) )
wat :: IO ()
wat = print $(let playGame []     = do
                      (_, score) <- get
                      return score
                  playGame (x:xs) = do
                      (on, score) <- get
                      case x of
                           'a' | on -> put (on, score + 1)
                           'b' | on -> put (on, score - 1)
                           'c'      -> put (not on, score)
                           _        -> put (on, score)
                      playGame xs

                  startState :: (Bool, Int)
                  startState = (False, 0)
              in TH.lift (evalState (playGame "abcaaacbbcabbab") startState) )
wat = print $(let playGame []     = do
                      (_, score) <- get
                      return score
                  playGame (x:xs) = do
                      (on, score) <- get
                      case x of
                           'a' | on -> put (on, score + 1)
                           'b' | on -> put (on, score - 1)
                           'c'      -> put (not on, score)
                           _        -> put (on, score)
                      playGame xs

                  startState :: (Bool, Int)
                  startState = (False, 0)
              in TH.lift (evalState (playGame "abcaaacbbcabbab") startState) )