aboutsummaryrefslogtreecommitdiff
path: root/challenge-041
diff options
context:
space:
mode:
authorchirvasitua <stuart-little@users.noreply.github.com>2021-01-12 20:35:59 -0500
committerchirvasitua <stuart-little@users.noreply.github.com>2021-01-12 20:35:59 -0500
commit71d677e4c8a1335c6420bac6b095255131db42e6 (patch)
tree707b5385063813cd1b0ecb43a5f1a0aff51a6d8a /challenge-041
parente5693c3489e6e561976f1728e1ef6f975bf0bd94 (diff)
downloadperlweeklychallenge-club-71d677e4c8a1335c6420bac6b095255131db42e6.tar.gz
perlweeklychallenge-club-71d677e4c8a1335c6420bac6b095255131db42e6.tar.bz2
perlweeklychallenge-club-71d677e4c8a1335c6420bac6b095255131db42e6.zip
1st commit on 041_haskell
Diffstat (limited to 'challenge-041')
-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):))