Skip to content

Instantly share code, notes, and snippets.

@stephenjbarr
Created March 8, 2014 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephenjbarr/9440087 to your computer and use it in GitHub Desktop.
Save stephenjbarr/9440087 to your computer and use it in GitHub Desktop.
{-| print_inst_uuid_list
Given a list of [IndividualParameterization], and an output filename
print a csv file describing each IndividualParameterization, one line
each.
-}
print_inst_uuid_list :: [IndividualParameterization] -> String -> IO ()
print_inst_uuid_list xlist fname =
do
let headerstring = inputst_csv_string ++ ",nstep_s,nstep_w,uuid"
let inst_strings = map (inputst_to_csv_string . _ipp_inst) xlist
let comma x y = x ++ "," ++ y
let rest_strings = map ipp_csv_no_inst xlist
let fstrings = zipWith comma inst_strings rest_strings
h <- openFile fname WriteMode
hPutStrLn h headerstring
mapM_ (hPutStrLn h) fstrings
hClose h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment