From 8144edd6765cd1063bebde8c5d3db42305fbdb9c Mon Sep 17 00:00:00 2001 From: Bill Ewanick Date: Wed, 18 Oct 2023 23:26:03 -0400 Subject: [PATCH] Thoughts on 1 --- src/projectEuler/question1.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/projectEuler/question1.hs b/src/projectEuler/question1.hs index 3b25706..dd669a7 100644 --- a/src/projectEuler/question1.hs +++ b/src/projectEuler/question1.hs @@ -13,6 +13,9 @@ main = print ans ans :: Integer ans = sum $ allNumbersUnder 1000 +sum' :: Num a => [a] -> a +sum' = foldl (+) 0 + isMultipleOf :: Integral a => a -> a -> Bool isMultipleOf n x = x `rem` n == 0