Created
May 1, 2014 20:53
-
-
Save patrickt/ba2c184106656b2c1ff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.ByteString (ByteString) | |
import System.Environment | |
import System.IO (openFile, IOMode (..)) | |
import System.IO.Streams (InputStream, concatInputStreams, connectTo) | |
import System.IO.Streams.Handle (handleToInputStream, stdout) | |
argf :: IO (InputStream ByteString) | |
argf = do | |
args <- fmap tail getArgs | |
handles <- mapM (flip openFile ReadMode) args | |
streams <- mapM handleToInputStream handles | |
concatInputStreams streams | |
main :: IO () | |
main = argf >>= connectTo stdout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment