main :: IO ()
main = do
   args <- getArgs
   when (length args > 0) $ do
      let mpirunFlags = init args
          (sourceFile, exeFile) = getFileNames $ last args
      run $ "ghc -v0 --make -O2 " ++ sourceFile
      run $ "mpirun " ++ unwords (mpirunFlags ++ [exeFile])
      run $ "rm -f *.o *.hi " ++ exeFile
main :: IO ()
main = do
   args <- getArgs
   when (length args > 0) $ do
      let mpirunFlags = init args
          (sourceFile, exeFile) = getFileNames $ last args
      run $ "ghc -v0 --make -O2 " ++ sourceFile
      run $ "mpirun " ++ unwords (mpirunFlags ++ [exeFile])
      run $ "rm -f *.o *.hi " ++ exeFile
main = do
   args <- getArgs
   when (length args > 0) $ do
      let mpirunFlags = init args
          (sourceFile, exeFile) = getFileNames $ last args
      run $ "ghc -v0 --make -O2 " ++ sourceFile
      run $ "mpirun " ++ unwords (mpirunFlags ++ [exeFile])
      run $ "rm -f *.o *.hi " ++ exeFile