327 ("Bool", ["True", "False"]), |
327 ("Bool", ["True", "False"]), |
328 ("Maybe", ["Nothing", "Just"]) |
328 ("Maybe", ["Nothing", "Just"]) |
329 ]; |
329 ]; |
330 |
330 |
331 fun serialize_haskell module_prefix string_classes ctxt { module_name, |
331 fun serialize_haskell module_prefix string_classes ctxt { module_name, |
332 reserved_syms, identifiers, includes, class_syntax, tyco_syntax, const_syntax } program = |
332 reserved_syms, identifiers, includes, class_syntax, tyco_syntax, const_syntax } exports program = |
333 let |
333 let |
334 |
334 |
335 (* build program *) |
335 (* build program *) |
336 val reserved = fold (insert (op =) o fst) includes reserved_syms; |
336 val reserved = fold (insert (op =) o fst) includes reserved_syms; |
337 val { deresolver, flat_program = haskell_program } = haskell_program_of_program |
337 val { deresolver, flat_program = haskell_program } = haskell_program_of_program |
338 ctxt module_prefix module_name (Name.make_context reserved) identifiers program; |
338 ctxt module_prefix module_name (Name.make_context reserved) identifiers exports program; |
339 |
339 |
340 (* print statements *) |
340 (* print statements *) |
341 fun deriving_show tyco = |
341 fun deriving_show tyco = |
342 let |
342 let |
343 fun deriv _ "fun" = false |
343 fun deriv _ "fun" = false |