aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-08 04:29:28 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-08 04:29:28 +0000
commit44e725659b941682c621a2fd9309ab4acc8ab199 (patch)
treed6f8ff36b790a0b1b77688d488a88859d20a9ec1 /src
downloadlab-04-master.tar.gz
publishHEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/Lib.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Lib.hs b/src/Lib.hs
new file mode 100644
index 0000000..106a981
--- /dev/null
+++ b/src/Lib.hs
@@ -0,0 +1,12 @@
1module Lib
2 ( isCongruent
3 , zipWithSum
4 ) where
5
6isCongruent :: Int -> Int -> Int -> Bool
7isCongruent a b m = (a `mod` m) == (b `mod` m)
8
9zipWithSum :: [Int] -> [Int] -> [Int]
10zipWithSum [] ys = ys
11zipWithSum xs [] = xs
12zipWithSum (x:xs) (y:ys) = (x + y) : zipWithSum xs ys