From a05b6b3e150bb051c1daae66f0f56d1accc5285b Mon Sep 17 00:00:00 2001 From: Yoo Chung Date: Fri, 31 May 2024 21:38:25 -0400 Subject: [PATCH] Remove use of head. --- test/Problems/P98Spec.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Problems/P98Spec.hs b/test/Problems/P98Spec.hs index 4c05336..d559c0c 100644 --- a/test/Problems/P98Spec.hs +++ b/test/Problems/P98Spec.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -Wno-x-partial -Wno-unrecognised-warning-flags #-} - {-| Copyright: Copyright (C) 2023 Yoo Chung License: GPL-3.0-or-later @@ -55,7 +53,9 @@ spec = parallel $ do getRows :: [[Bool]] -> [[Int]] getRows = map lengths - where lengths bs = map length $ filter head $ group bs + where lengths bs = map length $ filter occupied $ group bs + occupied (v:_) = v + occupied [] = False getColumns :: [[Bool]] -> [[Int]] getColumns = getRows . transpose