Skip to content

Instantly share code, notes, and snippets.

@moonmaster9000
Created April 11, 2010 22:04
Show Gist options
  • Save moonmaster9000/363104 to your computer and use it in GitHub Desktop.
Save moonmaster9000/363104 to your computer and use it in GitHub Desktop.
import System.Environment (getArgs)
import LineEndingConverter
main =
do
args <- getArgs
case args of
[input,output] ->
transformFileWith transformerFunction input output
_ -> error "You must provide two filenames."
where
transformerFunction = convertStringToUnixStyleLineEndings
-- transforms inputFile with transformerFunction
-- and writes the output to outputFile
transformFileWith transformerFunction inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (transformerFunction input)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment