packages feed

lhae-0.0.2: src/Util/Gnuplot.hs

module Util.Gnuplot (run)
    where

import Control.Monad (forM_)
import System.Exit (ExitCode(..))
import System.Cmd (rawSystem)

run :: (FilePath,String) -> [(FilePath,String)] -> IO ExitCode
run (gnuplotFile,gnuplotData) dataFiles = do
  writeFile gnuplotFile gnuplotData
  forM_ dataFiles $ uncurry writeFile
  rawSystem "gnuplot" [gnuplotFile]