<commit_before>data Character = Character { hp :: Int,
                             ac :: Int,
                             damage :: Int,
                             hit :: Int,
                             name :: String
                           } deriving (Show)


executeAttack :: Character -> Character -> Int
executeAttack attacker defender
    | connected = resultHp
    | otherwise = hp defender
    where connected = resolveHit (ac defender) (hit attacker)
          resultHp = hp defender - damage attacker

attackTillDead :: Character -> Character -> [(Character, Int)]
attackTillDead attacker defender
    | hp attacker <= 0 = []
    | otherwise = (defender, executeAttack attacker defender) : attackTillDead (updateHp defender resultHp) attacker
    where resultHp = executeAttack attacker defender

resolveHit :: Int -> Int -> Bool
resolveHit defense hit = defense < hit

updateHp :: Character -> Int -> Character
updateHp character remaining = character {hp = remaining}<commit_msg>Module exports and removed dummy name<commit_after>module Combat(
              Character(..),
              executeFullCombat)
              where

data Character = Character { hp :: Int,
                             ac :: Int,
                             damage :: Int,
                             hit :: Int,
                             name :: String
                           } deriving (Show)

executeFullCombat :: Character -> Character -> [(Character, Int)]
executeFullCombat attacker defender
    | hp attacker <= 0 = []
    | otherwise = (defender, executeAttack attacker defender) : executeFullCombat (updateHp defender resultHp) attacker
    where resultHp = executeAttack attacker defender

executeAttack :: Character -> Character -> Int
executeAttack attacker defender
    | connected = resultHp
    | otherwise = hp defender
    where connected = resolveHit (ac defender) (hit attacker)
          resultHp = hp defender - damage attacker

resolveHit :: Int -> Int -> Bool
resolveHit defense hit = defense < hit

updateHp :: Character -> Int -> Character
updateHp character remaining = character {hp = remaining}
{'fraction_non_alphanumeric': 0.0812206572769953, 'fraction_numerical': 0.0009389671361502347, 'mean_word_length': 2.129221732745962, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6385053', 'n_tokens_mistral': 533, 'n_tokens_neox': 489, 'n_words': 177}