--- a/src/Tools/Code/code_haskell.ML Mon Aug 30 16:11:09 2010 +0200
+++ b/src/Tools/Code/code_haskell.ML Mon Aug 30 16:17:10 2010 +0200
@@ -315,7 +315,7 @@
fun serialize_haskell module_prefix module_name string_classes labelled_name
raw_reserved includes module_alias
- syntax_class syntax_tyco syntax_const (code_of_pretty, code_writeln) program
+ syntax_class syntax_tyco syntax_const program
(stmt_names, presentation_stmt_names) width =
let
val reserved = fold (insert (op =) o fst) includes raw_reserved;
@@ -377,7 +377,7 @@
if null presentation_stmt_names then serialize_module1 else pair "" o serialize_module2;
fun check_destination destination =
(File.check destination; destination);
- fun write_module destination (modlname, content) =
+ fun write_module width destination (modlname, content) =
let
val filename = case modlname
of "" => Path.explode "Main.hs"
@@ -387,13 +387,13 @@
val _ = File.mkdir_leaf (Path.dir pathname);
in File.write pathname
("{-# OPTIONS_GHC -fglasgow-exts #-}\n\n"
- ^ code_of_pretty content)
+ ^ string_of_pretty width content)
end
in
Code_Target.mk_serialization
- (fn width => (fn NONE => K () o map (code_writeln o snd)
- | SOME file => K () o map (write_module (check_destination file))))
- (fn width => (rpair [] o cat_lines o map (code_of_pretty o snd)))
+ (fn width => (fn NONE => K () o map (writeln_pretty width o snd)
+ | SOME file => K () o map (write_module width (check_destination file))))
+ (fn width => (rpair [] o cat_lines o map (string_of_pretty width o snd)))
(map (uncurry print_module) includes
@ map serialize_module (Symtab.dest hs_program))
width