From: sabadev Date: Sat, 10 Apr 2021 04:17:48 +0000 (-0400) Subject: Eta-reduction for randomRange. X-Git-Url: http://sabadev.xyz:4321/?p=avoidance.git;a=commitdiff_plain;h=refs%2Fheads%2Fmain Eta-reduction for randomRange. --- diff --git a/src/Game.hs b/src/Game.hs index 670f992..3bd4ab6 100644 --- a/src/Game.hs +++ b/src/Game.hs @@ -144,7 +144,7 @@ randomResult :: (Random a) => RandomState a randomResult = randomAction random randomRange :: (Random a) => (a, a) -> RandomState a -randomRange bounds = randomAction $ G.getRandom bounds +randomRange = randomAction . G.getRandom enemyStartPosition :: Direction -> RandomState G.Coords enemyStartPosition U = randomRange (fst topLeftBoundary, fst bottomRightBoundary) >>= \column -> return (snd bottomRightBoundary, column)