diff options
| author | Steven Wilson <steven1170@zoho.eu> | 2022-01-04 09:50:11 +0000 |
|---|---|---|
| committer | Steven Wilson <steven1170@zoho.eu> | 2022-01-04 09:50:11 +0000 |
| commit | 9030d158bb89a81480aa91022f2ef030404dc704 (patch) | |
| tree | 40738e7170974da7cbe429240979bda8fad6ea60 /challenge-145 | |
| parent | 71db3413b752c37ccd910aab43422720e447818c (diff) | |
| download | perlweeklychallenge-club-9030d158bb89a81480aa91022f2ef030404dc704.tar.gz perlweeklychallenge-club-9030d158bb89a81480aa91022f2ef030404dc704.tar.bz2 perlweeklychallenge-club-9030d158bb89a81480aa91022f2ef030404dc704.zip | |
inprove haskell solution
Diffstat (limited to 'challenge-145')
| -rw-r--r-- | challenge-145/steven-wilson/haskell/ch-1.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-145/steven-wilson/haskell/ch-1.hs b/challenge-145/steven-wilson/haskell/ch-1.hs index 07c9912f18..5c340c09b2 100644 --- a/challenge-145/steven-wilson/haskell/ch-1.hs +++ b/challenge-145/steven-wilson/haskell/ch-1.hs @@ -1,3 +1,3 @@ -dot_product :: [Int] -> [Int] -> Int -dot_product [x] [y] = x * y +dot_product :: Num a => [a] -> [a] -> a +dot_product [] [] = 0 dot_product (x:xs) (y:ys) = (x * y) + dot_product (xs) (ys) |
