From 9607df29d572e92ae1a56efed62267c7719b2ad8 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Mon, 2 Dec 2024 19:59:19 +0000 Subject: [PATCH] Tidying --- advent02/Main.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/advent02/Main.hs b/advent02/Main.hs index cb75ccb..bd4df3a 100644 --- a/advent02/Main.hs +++ b/advent02/Main.hs @@ -20,10 +20,10 @@ isSafe, allSameSign, bigEnough, smallEnough, safeWhenDamped :: [Int] -> Bool isSafe xs = allSameSign diffs && bigEnough diffs && smallEnough diffs where diffs = zipWith (-) xs (tail xs) -allSameSign xs - | all (>0) xs = True - | all (<0) xs = True - | otherwise = False +allSameSign xs = (all (>0) xs) || (all (<0) xs) + -- | all (>0) xs = True + -- | all (<0) xs = True + -- | otherwise = False bigEnough = all ((>= 1) . abs) smallEnough = all ((<= 3) . abs) -- 2.34.1