commit a6cfade2951d1f3e1bf77c61ee0b6dd0ec62defe parent fc5878b2e89692ca486a6015316c45ffbc5b453d Author: Francesco Ariis <fa-ml@ariis.it> Date: Thu, 2 Mar 2023 12:31:06 +0100 Fix `gLogicFunction` documentation Diffstat:
M | src/Terminal/Game/Layer/Imperative.hs | | | 10 | +++------- |
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/Terminal/Game/Layer/Imperative.hs b/src/Terminal/Game/Layer/Imperative.hs @@ -37,13 +37,9 @@ data Game s r = Game { -- (e.g. 13 TPS is enough for action games). gInitState :: s, -- ^ Initial state of the game. gLogicFunction :: GEnv -> s -> Event -> Either r s, - -- ^ Logic function. @s@ is the game state while @r@ - -- is some sort of result you want to return when the - -- game is finished. - -- - -- If `gLogicFunction` returns 'Right' the game will - -- continue; if it returns 'Left' the game is over - -- (quit condition). + -- ^ Logic function. If `gLogicFunction` returns @Right s@ + -- the game will continue with state @s@; if it returns @Left@ + -- the game is over (quit condition). -- -- Curious to see how @r@ can be useful? Check -- @cabal run -f examples balls@ and