src/Tools/Haskell/Test.thy
author wenzelm
Fri, 30 Nov 2018 23:43:10 +0100
changeset 69381 4c9b4e2c5460
parent 69241 5426d266dcc5
child 69383 747f8b052e59
permissions -rw-r--r--
more general command 'generate_file' for registered file types, notably Haskell; discontinued 'generate_haskell_file', 'export_haskell_file'; eliminated generated sources: compile files in tmp dir;

(*  Title:      Tools/Haskell/Test.thy
    Author:     Makarius
*)

section \<open>Test build of Isabelle/Haskell modules\<close>

theory Test imports Haskell
begin

ML \<open>
  Isabelle_System.with_tmp_dir "ghc" (fn dir =>
    let
      val files = Generate_File.generate \<^theory>\<open>Haskell\<close> dir;
      val (out, rc) =
        Isabelle_System.bash_output
         (cat_lines
           ["set -e",
            "cd " ^ File.bash_path dir,
            "\"$ISABELLE_GHC\" " ^ File.bash_paths files]);
    in if rc = 0 then writeln out else error out end)
\<close>

end