aboutsummaryrefslogtreecommitdiff
path: root/challenge-059/stuart-little/haskell/ch-1.hs
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2021-01-13 06:12:43 +0000
committerGitHub <noreply@github.com>2021-01-13 06:12:43 +0000
commitde8edf2133ef637e908abd42cc1843797ae14b7e (patch)
treedd3c08774b00f4b409226abdddd7dcf184f4970f /challenge-059/stuart-little/haskell/ch-1.hs
parent664d2f45607ef860426754a1efc524d0580cf5dc (diff)
parentb251ab53893e59f77205203379f48f86827c9ca4 (diff)
downloadperlweeklychallenge-club-de8edf2133ef637e908abd42cc1843797ae14b7e.tar.gz
perlweeklychallenge-club-de8edf2133ef637e908abd42cc1843797ae14b7e.tar.bz2
perlweeklychallenge-club-de8edf2133ef637e908abd42cc1843797ae14b7e.zip
Merge pull request #3243 from stuart-little/stuart-little_059_haskell
1st commit on 059_haskell
Diffstat (limited to 'challenge-059/stuart-little/haskell/ch-1.hs')
-rwxr-xr-xchallenge-059/stuart-little/haskell/ch-1.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-059/stuart-little/haskell/ch-1.hs b/challenge-059/stuart-little/haskell/ch-1.hs
new file mode 100755
index 0000000000..c84128b8cd
--- /dev/null
+++ b/challenge-059/stuart-little/haskell/ch-1.hs
@@ -0,0 +1,12 @@
+#!/usr/bin/env runghc
+
+-- run <script> <cutoff_nr> <space-separated list entries>
+
+import System.Environment (getArgs,)
+import Control.Monad (liftM,)
+import Data.List (partition,)
+import Data.List.Utils (join,)
+
+main = do
+ (cut:rest) <- liftM (map (read::String->Int)) getArgs
+ putStrLn $ join " -> " $ map show $ uncurry (++) $ partition (cut >) rest