<commit_before>{-# LANGUAGE Arrows #-}
module Manager where

--------------------
-- Global Imports --
import Control.Wire

-------------------
-- Local Imports --
import InputHandler
import Config
import World
import Step

----------
-- Code --

-- | Managing the world and input manager.
manager :: (Fractional t, HasTime t s) => Wire s () IO a World
manager =
  proc _ -> do
    step  <- constStepper 0 updateStep -< undefined
    dir   <- inputHandlerV Upwards     -< step
    world <- stepIf worldWire          -< (dir, step)

    returnA -< world<commit_msg>Got rid of some corner case bugs.<commit_after>{-# LANGUAGE Arrows #-}
module Manager where

--------------------
-- Global Imports --
import Control.Wire
import Linear.V2

-------------------
-- Local Imports --
import InputHandler
import Config
import World
import Step

----------
-- Code --

-- | Managing the world and input manager.
manager :: (Fractional t, HasTime t s) => Wire s () IO a World
manager =
  proc _ -> do
    step  <- constStepper updateStep 0 -< undefined
    dir   <- inputHandlerV NoDir       -< step
    world <- stepIf worldWire          -< (dir, step && dir /= V2 0 0)

    returnA -< world
{'fraction_non_alphanumeric': 0.18104906937394247, 'fraction_numerical': 0.005076142131979695, 'mean_word_length': 1.8853658536585365, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4773751', 'n_tokens_mistral': 357, 'n_tokens_neox': 336, 'n_words': 125}