aboutsummaryrefslogtreecommitdiff
path: root/challenge-059/stuart-little/haskell/ch-1.hs
diff options
context:
space:
mode:
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