From: Neil Smith Date: Mon, 2 Dec 2024 19:59:19 +0000 (+0000) Subject: Tidying X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=9607df29d572e92ae1a56efed62267c7719b2ad8;p=advent-of-code-24.git Tidying --- 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)