diff options
| author | 2026-11-08 04:29:28 +0000 | |
|---|---|---|
| committer | 2026-11-08 04:29:28 +0000 | |
| commit | 44e725659b941682c621a2fd9309ab4acc8ab199 (patch) | |
| tree | d6f8ff36b790a0b1b77688d488a88859d20a9ec1 /src/Lib.hs | |
| download | lab-04-master.tar.gz | |
Diffstat (limited to 'src/Lib.hs')
| -rw-r--r-- | src/Lib.hs | 12 |
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 @@ | |||
| 1 | module Lib | ||
| 2 | ( isCongruent | ||
| 3 | , zipWithSum | ||
| 4 | ) where | ||
| 5 | |||
| 6 | isCongruent :: Int -> Int -> Int -> Bool | ||
| 7 | isCongruent a b m = (a `mod` m) == (b `mod` m) | ||
| 8 | |||
| 9 | zipWithSum :: [Int] -> [Int] -> [Int] | ||
| 10 | zipWithSum [] ys = ys | ||
| 11 | zipWithSum xs [] = xs | ||
| 12 | zipWithSum (x:xs) (y:ys) = (x + y) : zipWithSum xs ys | ||
