Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat codebase with Fourmolu #370

Merged
merged 3 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Restyled by fourmolu (#375)
Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
restyled-io[bot] and restyled-commits authored Jun 8, 2022
commit f1e8e0dce7f98fbe7f70bb6c98a1542ca4d29eda
2 changes: 1 addition & 1 deletion src/Swarm/Game/State.hs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ viewingRegion :: GameState -> (Int64, Int64) -> (W.Coords, W.Coords)
viewingRegion g (w, h) = (W.Coords (rmin, cmin), W.Coords (rmax, cmax))
where
V2 cx cy = g ^. viewCenter
(rmin, rmax) = over both (+ (-cy - h `div` 2)) (0, h - 1)
(rmin, rmax) = over both (+ (- cy - h `div` 2)) (0, h - 1)
(cmin, cmax) = over both (+ (cx - w `div` 2)) (0, w - 1)

-- | Find out which robot is currently specified by the
Expand Down
2 changes: 1 addition & 1 deletion src/Swarm/Game/Step.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ execConst c vs s k = do
[VBool b] -> return $ Out (VBool (not b)) s k
_ -> badConst
Neg -> case vs of
[VInt n] -> return $ Out (VInt (-n)) s k
[VInt n] -> return $ Out (VInt (- n)) s k
_ -> badConst
Eq -> returnEvalCmp
Neq -> returnEvalCmp
Expand Down
4 changes: 2 additions & 2 deletions src/Swarm/Game/World.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ instance Wrapped Coords

-- | Convert an (x,y) location to a 'Coords' value.
locToCoords :: V2 Int64 -> Coords
locToCoords (V2 x y) = Coords (-y, x)
locToCoords (V2 x y) = Coords (- y, x)

-- | Convert 'Coords' to an (x,y) location.
coordsToLoc :: Coords -> V2 Int64
coordsToLoc (Coords (r, c)) = V2 c (-r)
coordsToLoc (Coords (r, c)) = V2 c (- r)

------------------------------------------------------------
-- World function
Expand Down
6 changes: 3 additions & 3 deletions src/Swarm/Language/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ allDirs = [minBound .. maxBound]
-- | Information about all directions
dirInfo :: Direction -> DirInfo
dirInfo d = case d of
DLeft -> relative (\(V2 x y) -> V2 (-y) x)
DRight -> relative (\(V2 x y) -> V2 y (-x))
DBack -> relative (\(V2 x y) -> V2 (-x) (-y))
DLeft -> relative (\(V2 x y) -> V2 (- y) x)
DRight -> relative (\(V2 x y) -> V2 y (- x))
DBack -> relative (\(V2 x y) -> V2 (- x) (- y))
DForward -> relative id
DNorth -> cardinal north
DSouth -> cardinal south
Expand Down