From 34d82d9451e331cc92a9e472a267bab8198af577 Mon Sep 17 00:00:00 2001 From: Sam Tay Date: Sat, 17 Jun 2017 16:59:46 -0400 Subject: [PATCH] Favor list comprehension over zip --- src/Tetris.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tetris.hs b/src/Tetris.hs index 19ce3ae..45a1143 100644 --- a/src/Tetris.hs +++ b/src/Tetris.hs @@ -224,7 +224,7 @@ isStopped brd = any cStopped . coords freezeBlock :: Game -> Game freezeBlock g = g & board %~ (M.union blkMap) where blk = g ^. block - blkMap = M.fromList $ zip (blk ^. to coords) (repeat $ blk ^. shape) + blkMap = M.fromList $ [(c, blk ^. shape) | c <- blk ^. to coords] -- | Replace block with next block nextBlock :: Game -> IO Game