diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-04-16 11:28:06 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-04-16 11:28:06 +0100 |
commit | bcb2baca918b758c77feabed7342d53559c5d897 (patch) | |
tree | c358fb68861dd9f5029950003d76db7b8e76b0b9 /src/Game | |
parent | 3eb66a2125caefe61729c0999c8813c3847957cd (diff) | |
download | space-plat-hs-bcb2baca918b758c77feabed7342d53559c5d897.tar.gz space-plat-hs-bcb2baca918b758c77feabed7342d53559c5d897.zip |
A bit more functional
Diffstat (limited to 'src/Game')
-rw-r--r-- | src/Game/Toaster.hs | 7 |
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 |