Skip to content

Instantly share code, notes, and snippets.

@duboisf
Created April 28, 2010 12:32
Show Gist options
  • Save duboisf/382076 to your computer and use it in GitHub Desktop.
Save duboisf/382076 to your computer and use it in GitHub Desktop.
tail.hs
import System.Environment (getArgs)
main =
getArgs >>= \[nbLines, filename] ->
lines `fmap` readFile filename >>= \contents ->
mapM_ putStrLn (drop (length contents - (read nbLines :: Int)) contents)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment