aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2021-01-13 03:18:29 +0000
committerGitHub <noreply@github.com>2021-01-13 03:18:29 +0000
commit3d6d1a6bcb4d58dac5c09abb0c4f5bc42f0fa944 (patch)
tree9eab46fea967dea4302701f7bdbe9afe02c793a7
parentf506839f43682a3ba4ba53330e9bf3663078b924 (diff)
parent71d677e4c8a1335c6420bac6b095255131db42e6 (diff)
downloadperlweeklychallenge-club-3d6d1a6bcb4d58dac5c09abb0c4f5bc42f0fa944.tar.gz
perlweeklychallenge-club-3d6d1a6bcb4d58dac5c09abb0c4f5bc42f0fa944.tar.bz2
perlweeklychallenge-club-3d6d1a6bcb4d58dac5c09abb0c4f5bc42f0fa944.zip
Merge pull request #3241 from stuart-little/stuart-little_041_haskell
1st commit on 041_haskell
-rwxr-xr-xchallenge-041/stuart-little/haskell/ch-1.hs8
-rwxr-xr-xchallenge-041/stuart-little/haskell/ch-2.hs8
2 files changed, 16 insertions, 0 deletions
diff --git a/challenge-041/stuart-little/haskell/ch-1.hs b/challenge-041/stuart-little/haskell/ch-1.hs
new file mode 100755
index 0000000000..0d251cceed
--- /dev/null
+++ b/challenge-041/stuart-little/haskell/ch-1.hs
@@ -0,0 +1,8 @@
+#!/usr/bin/env runghc
+
+-- run <script>
+
+import Data.Numbers.Primes (isPrime,primeFactors,)
+
+main = do
+ mapM_ print $ filter (isPrime.length.primeFactors) [1..50]
diff --git a/challenge-041/stuart-little/haskell/ch-2.hs b/challenge-041/stuart-little/haskell/ch-2.hs
new file mode 100755
index 0000000000..b3ddaaf4c2
--- /dev/null
+++ b/challenge-041/stuart-little/haskell/ch-2.hs
@@ -0,0 +1,8 @@
+#!/usr/bin/env runghc
+
+-- run <script>
+
+import Data.Function (fix,)
+
+main = do
+ mapM_ print $ take 20 $ fix (scanl (\x y -> x + y + 1) 1 . ((-1):))