384 o Long_Name.explode) modlname; |
384 o Long_Name.explode) modlname; |
385 val pathname = Path.append destination filename; |
385 val pathname = Path.append destination filename; |
386 val _ = File.mkdir_leaf (Path.dir pathname); |
386 val _ = File.mkdir_leaf (Path.dir pathname); |
387 in File.write pathname |
387 in File.write pathname |
388 ("{-# OPTIONS_GHC -fglasgow-exts #-}\n\n" |
388 ("{-# OPTIONS_GHC -fglasgow-exts #-}\n\n" |
389 ^ string_of_pretty width content) |
389 ^ format false width content) |
390 end |
390 end |
391 | write_module width NONE (_, content) = writeln_pretty width content; |
391 | write_module width NONE (_, content) = writeln (format false width content); |
392 in |
392 in |
393 Code_Target.serialization |
393 Code_Target.serialization |
394 (fn width => fn destination => K () o map (write_module width destination)) |
394 (fn width => fn destination => K () o map (write_module width destination)) |
395 (fn width => rpair [] o cat_lines o map (string_of_pretty width o snd)) |
395 (fn present => fn width => rpair [] o format present width o Pretty.chunks o map snd) |
396 (map (uncurry print_module) includes |
396 (map (uncurry print_module) includes |
397 @ map serialize_module (Symtab.dest hs_program)) |
397 @ map serialize_module (Symtab.dest hs_program)) |
398 end; |
398 end; |
399 |
399 |
400 val serializer : Code_Target.serializer = |
400 val serializer : Code_Target.serializer = |