Skip to content

Instantly share code, notes, and snippets.

@shapr
Created December 28, 2023 16:40
Show Gist options
  • Save shapr/1bbb47ff63c1d9d0a5401b8ddbee5f5f to your computer and use it in GitHub Desktop.
Save shapr/1bbb47ff63c1d9d0a5401b8ddbee5f5f to your computer and use it in GitHub Desktop.
module Main where
import System.Environment
import System.IO
main :: IO ()
main = do
withFile
"/tmp/stdin.txt"
AppendMode
( \handle ->
do
hPutStrLn handle "----"
args <- getArgs
progName <- getProgName
hPutStrLn handle $ progName <> " " <> unwords args
stdIn <- getContents
hPutStrLn handle stdIn
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment