src/Tools/Haskell/Test.thy
author wenzelm
Thu, 16 Jul 2020 14:36:43 +0200
changeset 72045 2c7cfd2f9b6c
parent 70082 4f936de6d9b8
child 74080 5b68a5cd7061
permissions -rw-r--r--
more thorough extend/merge, notably for master_dir across Theory.join_theory (e.g. for @{file} antiquotation);

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

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

theory Test
  imports Haskell
begin

compile_generated_files _ (in Haskell)
  where \<open>fn dir =>
    let
      val modules =
        Generated_Files.get_files \<^theory>\<open>Haskell\<close>
        |> map (#path #> Path.implode #> unsuffix ".hs" #> space_explode "/" #> space_implode ".");
      val _ =
        GHC.new_project dir
          {name = "isabelle",
           depends =
            ["bytestring", "containers", "network", "split", "threads", "utf8-string", "uuid"],
           modules = modules};
    in
      writeln (Generated_Files.execute dir \<open>Build\<close> "mv Isabelle src && isabelle ghc_stack build")
    end\<close>

end