Skip to content

Instantly share code, notes, and snippets.

@ndtimofeev
Last active February 5, 2018 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndtimofeev/25d343fc6632947066a6ac12eb996bd1 to your computer and use it in GitHub Desktop.
Save ndtimofeev/25d343fc6632947066a6ac12eb996bd1 to your computer and use it in GitHub Desktop.
import System.Environment
import Data.Function
main :: IO ()
main = do
path:_ <- getArgs
txt <- readFile path
print $ fix
(\go xs -> case xs of
numStr : xs' ->
let (result, rest) = splitAt (read numStr) xs'
in result : go rest
[] -> []) (lines txt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment