--- a/src/Tools/Code/code_haskell.ML Tue Sep 07 16:37:23 2010 +0200
+++ b/src/Tools/Code/code_haskell.ML Tue Sep 07 16:49:32 2010 +0200
@@ -329,8 +329,7 @@
map (fn (name, _) => str ("import qualified " ^ name ^ ";")) includes;
fun print_module_frame module_name ps =
(module_name, Pretty.chunks2 (
- str "{-# OPTIONS_GHC -fglasgow-exts #-}"
- :: str ("module " ^ module_name ^ " where {")
+ str ("module " ^ module_name ^ " where {")
:: ps
@| str "}"
));
@@ -355,7 +354,10 @@
val filepath = (Path.append destination o Path.ext "hs" o Path.explode o implode
o separate "/" o Long_Name.explode) module_name;
val _ = File.mkdir_leaf (Path.dir filepath);
- in File.write filepath (format [] width content) end
+ in
+ (File.write filepath o format [] width o Pretty.chunks2)
+ [str "{-# OPTIONS_GHC -fglasgow-exts #-}", content]
+ end
| write_module width NONE (_, content) = writeln (format [] width content);
in
Code_Target.serialization