impl :: AST -> String -> Rendered
impl ast modname
 = let out_h_name = modname ++ ".h"
       out_c_name = modname ++ ".c"
   in Rendered
       { path = []
       , fname = out_c_name
       , contents = runPrinter $
           do sayln' $ "/**"
              sayln' $ " * @file " ++ out_c_name
              sayln' $ " */"
              sayln' $ ""
              sayln' $ ""
              sayln' $ "#include <string.h>"
              sayln' $ "#include <stdlib.h>"
              sayln' $ "#include <" ++ out_h_name ++ ">"
              sayln' $ ""
              sayln' $ ""
              mapM_ (\x -> functionImpls x >> sayln' "") (ast_defs ast)
              sayln' $ ""
              sayln' $ ""
       }
impl :: AST -> String -> Rendered
impl ast modname
 = let out_h_name = modname ++ ".h"
       out_c_name = modname ++ ".c"
   in Rendered
       { path = []
       , fname = out_c_name
       , contents = runPrinter $
           do sayln' $ "/**"
              sayln' $ " * @file " ++ out_c_name
              sayln' $ " */"
              sayln' $ ""
              sayln' $ ""
              sayln' $ "#include <string.h>"
              sayln' $ "#include <stdlib.h>"
              sayln' $ "#include <" ++ out_h_name ++ ">"
              sayln' $ ""
              sayln' $ ""
              mapM_ (\x -> functionImpls x >> sayln' "") (ast_defs ast)
              sayln' $ ""
              sayln' $ ""
       }
impl ast modname
 = let out_h_name = modname ++ ".h"
       out_c_name = modname ++ ".c"
   in Rendered
       { path = []
       , fname = out_c_name
       , contents = runPrinter $
           do sayln' $ "/**"
              sayln' $ " * @file " ++ out_c_name
              sayln' $ " */"
              sayln' $ ""
              sayln' $ ""
              sayln' $ "#include <string.h>"
              sayln' $ "#include <stdlib.h>"
              sayln' $ "#include <" ++ out_h_name ++ ">"
              sayln' $ ""
              sayln' $ ""
              mapM_ (\x -> functionImpls x >> sayln' "") (ast_defs ast)
              sayln' $ ""
              sayln' $ ""
       }