aboutsummaryrefslogtreecommitdiff
path: root/src/Lib.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Lib.hs')
-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