From 0d60b145931fd665ab55837b64f580759a39a796 Mon Sep 17 00:00:00 2001 From: "restyled-io[bot]" <32688539+restyled-io[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:39:42 -0500 Subject: [PATCH] Restyled by fourmolu (#2163) Co-authored-by: Restyled.io --- app/game/Main.hs | 2 +- src/swarm-engine/Swarm/Game/ScenarioInfo.hs | 2 +- src/swarm-engine/Swarm/Game/State/Robot.hs | 2 +- src/swarm-engine/Swarm/Game/State/Runtime.hs | 2 +- src/swarm-engine/Swarm/Game/Step/Const.hs | 2 +- src/swarm-engine/Swarm/Game/Step/Util.hs | 2 +- src/swarm-scenario/Swarm/Game/Entity.hs | 2 +- src/swarm-scenario/Swarm/Game/Scenario.hs | 2 +- src/swarm-scenario/Swarm/Game/State/Config.hs | 2 +- src/swarm-scenario/Swarm/Game/World/Load.hs | 2 +- src/swarm-tui/Swarm/TUI/Controller.hs | 2 +- src/swarm-tui/Swarm/TUI/Model/KeyBindings.hs | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/game/Main.hs b/app/game/Main.hs index 500ae6ec7..5904a0578 100644 --- a/app/game/Main.hs +++ b/app/game/Main.hs @@ -17,10 +17,10 @@ import GitHash (GitInfo, giBranch, giHash, tGitInfoCwdTry) import Options.Applicative import Options.Applicative.Help hiding (color, fullDesc) import Swarm.App (appMain) -import Swarm.ResourceLoading (getSwarmConfigIniFile) import Swarm.Language.Format import Swarm.Language.LSP (lspMain) import Swarm.Language.Parser.Core (LanguageVersion (..)) +import Swarm.ResourceLoading (getSwarmConfigIniFile) import Swarm.TUI.Model (AppOpts (..), ColorMode (..)) import Swarm.TUI.Model.DebugOption import Swarm.TUI.Model.KeyBindings (KeybindingPrint (..), showKeybindings) diff --git a/src/swarm-engine/Swarm/Game/ScenarioInfo.hs b/src/swarm-engine/Swarm/Game/ScenarioInfo.hs index bb52d7ec5..514fce85e 100644 --- a/src/swarm-engine/Swarm/Game/ScenarioInfo.hs +++ b/src/swarm-engine/Swarm/Game/ScenarioInfo.hs @@ -57,10 +57,10 @@ import Data.Sequence qualified as Seq import Data.Text (Text) import Data.Yaml as Y import Swarm.Failure -import Swarm.ResourceLoading (getDataDirSafe, getSwarmSavePath) import Swarm.Game.Scenario import Swarm.Game.Scenario.Scoring.CodeSize import Swarm.Game.Scenario.Status +import Swarm.ResourceLoading (getDataDirSafe, getSwarmSavePath) import Swarm.Util.Effect (warn, withThrow) import System.Directory (canonicalizePath, doesDirectoryExist, doesFileExist, listDirectory) import System.FilePath (pathSeparator, splitDirectories, takeBaseName, takeExtensions, (-<.>), ()) diff --git a/src/swarm-engine/Swarm/Game/State/Robot.hs b/src/swarm-engine/Swarm/Game/State/Robot.hs index 2b38a1bd5..af89419b3 100644 --- a/src/swarm-engine/Swarm/Game/State/Robot.hs +++ b/src/swarm-engine/Swarm/Game/State/Robot.hs @@ -71,12 +71,12 @@ import Data.Tuple (swap) import GHC.Generics (Generic) import Swarm.Game.CESK (CESK (Waiting)) import Swarm.Game.Location -import Swarm.ResourceLoading (NameGenerator) import Swarm.Game.Robot import Swarm.Game.Robot.Concrete import Swarm.Game.State.Config import Swarm.Game.Tick import Swarm.Game.Universe as U +import Swarm.ResourceLoading (NameGenerator) import Swarm.Util (binTuples, surfaceEmpty, (<+=), (<<.=)) import Swarm.Util.Lens (makeLensesExcluding) diff --git a/src/swarm-engine/Swarm/Game/State/Runtime.hs b/src/swarm-engine/Swarm/Game/State/Runtime.hs index b52819c5c..e3212ff1a 100644 --- a/src/swarm-engine/Swarm/Game/State/Runtime.hs +++ b/src/swarm-engine/Swarm/Game/State/Runtime.hs @@ -35,12 +35,12 @@ import Data.Text (Text) import Swarm.Failure (SystemFailure) import Swarm.Game.Land import Swarm.Game.Recipe (loadRecipes) -import Swarm.ResourceLoading (initNameGenerator, readAppData) import Swarm.Game.Scenario (GameStateInputs (..), ScenarioInputs (..)) import Swarm.Game.ScenarioInfo (ScenarioCollection, loadScenarios) import Swarm.Game.State.Substate import Swarm.Game.World.Load (loadWorlds) import Swarm.Log +import Swarm.ResourceLoading (initNameGenerator, readAppData) import Swarm.Util.Lens (makeLensesNoSigs) data RuntimeState = RuntimeState diff --git a/src/swarm-engine/Swarm/Game/Step/Const.hs b/src/swarm-engine/Swarm/Game/Step/Const.hs index eac372038..1c62d0ad0 100644 --- a/src/swarm-engine/Swarm/Game/Step/Const.hs +++ b/src/swarm-engine/Swarm/Game/Step/Const.hs @@ -55,7 +55,6 @@ import Swarm.Game.Exception import Swarm.Game.Land import Swarm.Game.Location import Swarm.Game.Recipe -import Swarm.ResourceLoading (getDataFileNameSafe) import Swarm.Game.Robot import Swarm.Game.Robot.Activity import Swarm.Game.Robot.Concrete @@ -95,6 +94,7 @@ import Swarm.Language.Text.Markdown qualified as Markdown import Swarm.Language.Value import Swarm.Log import Swarm.Pretty (prettyText) +import Swarm.ResourceLoading (getDataFileNameSafe) import Swarm.Util hiding (both) import Swarm.Util.Effect (throwToMaybe) import Swarm.Util.Lens (inherit) diff --git a/src/swarm-engine/Swarm/Game/Step/Util.hs b/src/swarm-engine/Swarm/Game/Step/Util.hs index 303deda4e..c66cd624b 100644 --- a/src/swarm-engine/Swarm/Game/Step/Util.hs +++ b/src/swarm-engine/Swarm/Game/Step/Util.hs @@ -27,7 +27,6 @@ import Swarm.Game.Device import Swarm.Game.Entity hiding (empty, lookup, singleton, union) import Swarm.Game.Exception import Swarm.Game.Location -import Swarm.ResourceLoading (NameGenerator (..)) import Swarm.Game.Robot import Swarm.Game.Scenario.Topography.Structure.Recognition.Tracking qualified as SRT import Swarm.Game.State @@ -45,6 +44,7 @@ import Swarm.Language.Capability import Swarm.Language.Requirements.Type qualified as R import Swarm.Language.Syntax import Swarm.Language.Syntax.Direction (Direction) +import Swarm.ResourceLoading (NameGenerator (..)) import Swarm.Util hiding (both) import System.Random (UniformRange, uniformR) import Prelude hiding (Applicative (..), lookup) diff --git a/src/swarm-scenario/Swarm/Game/Entity.hs b/src/swarm-scenario/Swarm/Game/Entity.hs index 2f936a906..c6d0c4f14 100644 --- a/src/swarm-scenario/Swarm/Game/Entity.hs +++ b/src/swarm-scenario/Swarm/Game/Entity.hs @@ -126,11 +126,11 @@ import Swarm.Game.Entity.Cosmetic (WorldAttr (..)) import Swarm.Game.Entity.Cosmetic.Assignment (worldAttributes) import Swarm.Game.Ingredients import Swarm.Game.Location -import Swarm.ResourceLoading (getDataFileNameSafe) import Swarm.Game.Terrain (TerrainType) import Swarm.Language.Capability import Swarm.Language.Syntax (Syntax) import Swarm.Language.Text.Markdown (Document, docToText) +import Swarm.ResourceLoading (getDataFileNameSafe) import Swarm.Util (binTuples, failT, findDup, plural, quote, (?)) import Swarm.Util.Effect (withThrow) import Swarm.Util.Yaml diff --git a/src/swarm-scenario/Swarm/Game/Scenario.hs b/src/swarm-scenario/Swarm/Game/Scenario.hs index 9b3a6c3cd..8a8ee9675 100644 --- a/src/swarm-scenario/Swarm/Game/Scenario.hs +++ b/src/swarm-scenario/Swarm/Game/Scenario.hs @@ -80,7 +80,6 @@ import Swarm.Game.Entity.Cosmetic.Assignment (worldAttributes) import Swarm.Game.Land import Swarm.Game.Location (Location) import Swarm.Game.Recipe -import Swarm.ResourceLoading (getDataFileNameSafe) import Swarm.Game.Robot (TRobot, trobotLocation, trobotName) import Swarm.Game.Scenario.Objective (Objective) import Swarm.Game.Scenario.Objective.Validation @@ -104,6 +103,7 @@ import Swarm.Game.World.Typecheck (WorldMap) import Swarm.Language.Syntax (Syntax, TSyntax) import Swarm.Language.Text.Markdown (Document) import Swarm.Pretty (prettyText) +import Swarm.ResourceLoading (getDataFileNameSafe) import Swarm.Util (binTuples, commaList, failT, quote) import Swarm.Util.Effect (ignoreWarnings, throwToMaybe, withThrow) import Swarm.Util.Lens (makeLensesNoSigs) diff --git a/src/swarm-scenario/Swarm/Game/State/Config.hs b/src/swarm-scenario/Swarm/Game/State/Config.hs index 92dc0e741..55a731051 100644 --- a/src/swarm-scenario/Swarm/Game/State/Config.hs +++ b/src/swarm-scenario/Swarm/Game/State/Config.hs @@ -7,8 +7,8 @@ module Swarm.Game.State.Config where import Data.Map (Map) import Data.Text (Text) -import Swarm.ResourceLoading (NameGenerator) import Swarm.Game.Scenario (GameStateInputs) +import Swarm.ResourceLoading (NameGenerator) -- | Record to pass information needed to create an initial -- 'GameState' record when starting a scenario. diff --git a/src/swarm-scenario/Swarm/Game/World/Load.hs b/src/swarm-scenario/Swarm/Game/World/Load.hs index 16b73fbf6..2a0365918 100644 --- a/src/swarm-scenario/Swarm/Game/World/Load.hs +++ b/src/swarm-scenario/Swarm/Game/World/Load.hs @@ -18,10 +18,10 @@ import Data.Sequence (Seq) import Data.Text (Text) import Swarm.Failure (Asset (..), AssetData (..), LoadingFailure (..), SystemFailure (..)) import Swarm.Game.Land -import Swarm.ResourceLoading (getDataDirSafe) import Swarm.Game.World.Parse (parseWExp, runParser) import Swarm.Game.World.Typecheck import Swarm.Pretty (prettyText) +import Swarm.ResourceLoading (getDataDirSafe) import Swarm.Util (acquireAllWithExt) import Swarm.Util.Effect (throwToWarning, withThrow) import System.FilePath (dropExtension, joinPath, splitPath) diff --git a/src/swarm-tui/Swarm/TUI/Controller.hs b/src/swarm-tui/Swarm/TUI/Controller.hs index ba88a9740..3eb787ff8 100644 --- a/src/swarm-tui/Swarm/TUI/Controller.hs +++ b/src/swarm-tui/Swarm/TUI/Controller.hs @@ -60,7 +60,6 @@ import Swarm.Game.Achievement.Definitions import Swarm.Game.CESK (CESK (Out), Frame (FApp, FExec, FSuspend)) import Swarm.Game.Entity hiding (empty) import Swarm.Game.Land -import Swarm.ResourceLoading (getSwarmHistoryPath) import Swarm.Game.Robot.Concrete import Swarm.Game.ScenarioInfo import Swarm.Game.State @@ -85,6 +84,7 @@ import Swarm.Language.Typecheck ( ) import Swarm.Language.Value (Value (VKey), envTypes) import Swarm.Log +import Swarm.ResourceLoading (getSwarmHistoryPath) import Swarm.TUI.Controller.EventHandlers import Swarm.TUI.Controller.SaveScenario (saveScenarioInfoOnQuit) import Swarm.TUI.Controller.UpdateUI diff --git a/src/swarm-tui/Swarm/TUI/Model/KeyBindings.hs b/src/swarm-tui/Swarm/TUI/Model/KeyBindings.hs index b85acf824..7911abf23 100644 --- a/src/swarm-tui/Swarm/TUI/Model/KeyBindings.hs +++ b/src/swarm-tui/Swarm/TUI/Model/KeyBindings.hs @@ -23,8 +23,8 @@ import Data.Maybe (fromMaybe, mapMaybe) import Data.Text (Text) import Data.Text qualified as T import Swarm.Failure (Asset (..), LoadingFailure (..), SystemFailure (..)) -import Swarm.ResourceLoading (getSwarmConfigIniFile) import Swarm.Pretty (prettyText) +import Swarm.ResourceLoading (getSwarmConfigIniFile) import Swarm.TUI.Controller.EventHandlers import Swarm.TUI.Model import Swarm.TUI.Model.Event (SwarmEvent, defaultSwarmBindings, swarmEvents)