modifyCounter :: (Monad m) => (Int -> Int) -> Counter -> CyoaT m ()
modifyCounter f counter = do
  modifyPlayerState $ \ps -> ps { player_counters = Map.alter f' counter (player_counters ps) }
  where f' mx = Just $ f $ 0 `fromMaybe` mx
modifyCounter :: (Monad m) => (Int -> Int) -> Counter -> CyoaT m ()
modifyCounter f counter = do
  modifyPlayerState $ \ps -> ps { player_counters = Map.alter f' counter (player_counters ps) }
  where f' mx = Just $ f $ 0 `fromMaybe` mx
modifyCounter f counter = do
  modifyPlayerState $ \ps -> ps { player_counters = Map.alter f' counter (player_counters ps) }
  where f' mx = Just $ f $ 0 `fromMaybe` mx