aboutsummaryrefslogtreecommitdiff
path: root/challenge-059/stuart-little/haskell/ch-1.hs
blob: c84128b8cd9521bad991bd6479b9f65e6f69d048 (plain)
1
2
3
4
5
6
7
8
9
10
11
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