multiWrite (filename:rest) (x:xs) = 
   do
      writeFile filename x                     
      multiWrite rest xs

-- takes a path to a directory, a command, a suffix and the total number of files
-- repeats the command for each file, e.g.
-- $ pdflatex path/1.tex
-- $ pdflatex path/2.tex
multiWrite (filename:rest) (x:xs) = 
   do
      writeFile filename x                     
      multiWrite rest xs

-- takes a path to a directory, a command, a suffix and the total number of files
-- repeats the command for each file, e.g.
-- $ pdflatex path/1.tex
-- $ pdflatex path/2.tex
multiWrite (filename:rest) (x:xs) = 
   do
      writeFile filename x                     
      multiWrite rest xs

-- takes a path to a directory, a command, a suffix and the total number of files
-- repeats the command for each file, e.g.
-- $ pdflatex path/1.tex
-- $ pdflatex path/2.tex