src/Tools/Code/code_haskell.ML
changeset 41246 e1da70df68c1
parent 40804 c8494f89690a
child 41343 71f4f15258a5
equal deleted inserted replaced
41245:cddc7db22bc9 41246:e1da70df68c1
   351     fun write_module width (SOME destination) (module_name, content) =
   351     fun write_module width (SOME destination) (module_name, content) =
   352           let
   352           let
   353             val _ = File.check destination;
   353             val _ = File.check destination;
   354             val filepath = (Path.append destination o Path.ext "hs" o Path.explode o implode
   354             val filepath = (Path.append destination o Path.ext "hs" o Path.explode o implode
   355               o separate "/" o Long_Name.explode) module_name;
   355               o separate "/" o Long_Name.explode) module_name;
   356             val _ = Isabelle_System.mkdir (Path.dir filepath);
   356             val _ = Isabelle_System.mkdirs (Path.dir filepath);
   357           in
   357           in
   358             (File.write filepath o format [] width o Pretty.chunks2)
   358             (File.write filepath o format [] width o Pretty.chunks2)
   359               [str "{-# LANGUAGE ScopedTypeVariables #-}", content]
   359               [str "{-# LANGUAGE ScopedTypeVariables #-}", content]
   360           end
   360           end
   361       | write_module width NONE (_, content) = writeln (format [] width content);
   361       | write_module width NONE (_, content) = writeln (format [] width content);