From bcb2baca918b758c77feabed7342d53559c5d897 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 16 Apr 2023 11:28:06 +0100 Subject: A bit more functional --- src/Game/Toaster.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Game') 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 -- cgit v1.2.3