aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-04-16 11:28:06 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-04-16 11:28:06 +0100
commitbcb2baca918b758c77feabed7342d53559c5d897 (patch)
treec358fb68861dd9f5029950003d76db7b8e76b0b9
parent3eb66a2125caefe61729c0999c8813c3847957cd (diff)
downloadspace-plat-hs-bcb2baca918b758c77feabed7342d53559c5d897.tar.gz
space-plat-hs-bcb2baca918b758c77feabed7342d53559c5d897.zip
A bit more functional
-rw-r--r--src/Game/Toaster.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Game/Toaster.hs b/src/Game/Toaster.hs
index 75907eb..b0920c5 100644
--- a/src/Game/Toaster.hs
+++ b/src/Game/Toaster.hs
@@ -7,6 +7,7 @@ module Game.Toaster
)
where
+import Data.Foldable (traverse_)
import qualified Game.BitmapFont as BM
import qualified SDL
@@ -50,7 +51,5 @@ update t = case t.current of
| otherwise = Nothing
render :: SDL.Renderer -> Toaster -> IO ()
-render renderer t = case t.current of
- Nothing -> pure ()
- Just toast -> do
- BM.renderTextSolid renderer t.font 4 toast.y toast.message
+render renderer t =
+ traverse_ (\toast -> BM.renderTextSolid renderer t.font 4 toast.y toast.message) t.current