aboutsummaryrefslogtreecommitdiff
path: root/challenge-001/stuart-little/haskell
diff options
context:
space:
mode:
authorchirvasitua <stuart-little@users.noreply.github.com>2020-12-31 10:55:04 -0500
committerchirvasitua <stuart-little@users.noreply.github.com>2020-12-31 10:55:04 -0500
commit1c5e3a7ebd869a85c0eb904451c139656d7b47fd (patch)
treeed74549619e92f69c4032056cc9e0a1cd48563cc /challenge-001/stuart-little/haskell
parentb22bd539ab5083cf0a8cbfab18f6107403751851 (diff)
downloadperlweeklychallenge-club-1c5e3a7ebd869a85c0eb904451c139656d7b47fd.tar.gz
perlweeklychallenge-club-1c5e3a7ebd869a85c0eb904451c139656d7b47fd.tar.bz2
perlweeklychallenge-club-1c5e3a7ebd869a85c0eb904451c139656d7b47fd.zip
1st commit on 001_haskell
Diffstat (limited to 'challenge-001/stuart-little/haskell')
-rwxr-xr-xchallenge-001/stuart-little/haskell/ch-1.hs9
-rwxr-xr-xchallenge-001/stuart-little/haskell/ch-2.hs6
2 files changed, 15 insertions, 0 deletions
diff --git a/challenge-001/stuart-little/haskell/ch-1.hs b/challenge-001/stuart-little/haskell/ch-1.hs
new file mode 100755
index 0000000000..340b1d58fb
--- /dev/null
+++ b/challenge-001/stuart-little/haskell/ch-1.hs
@@ -0,0 +1,9 @@
+#!/usr/bin/env runghc
+
+-- run as <script>
+
+s="Perl Weekly Challenge"
+
+main = do
+ putStrLn $ "Number of 'e's: " ++ (show $ length $ filter ((==) 'e') s)
+ putStrLn (let tr 'e' = 'E'; tr c = c in map tr s)
diff --git a/challenge-001/stuart-little/haskell/ch-2.hs b/challenge-001/stuart-little/haskell/ch-2.hs
new file mode 100755
index 0000000000..6d4dc47dec
--- /dev/null
+++ b/challenge-001/stuart-little/haskell/ch-2.hs
@@ -0,0 +1,6 @@
+#!/usr/bin/env runghc
+
+-- run as <script>
+
+main = do
+ mapM_ putStrLn (take 20 $ map (\(a,b) -> if (b == "") then a else b) (zip (map show [1..]) (zipWith (++) (cycle $ (replicate 2 "") ++ ["fizz"] ) (cycle $ (replicate 4 "") ++ ["buzz"] ))))