genConstructor' :: String -> [((String, Bool),String)] -> String
genConstructor' name types_names = concat [fst_line, snd_line, concat middle_lines, prelast_line, last_line]
    where fst_line = concat [name, " * new", name,"(", args, "){\n"] 
          args     = concat $ intersperse ", "$ cstructArguments' types_names
          snd_line = concat ["    ",name, " * ret = (",name,"*) malloc(sizeof(",name,"));\n"]
          middle_lines = zipWith (\n1 n2 -> concat ["    ret->",n1," = ",n2, ";\n"])  (map snd types_names) (map accessAsPointer types_names)
          prelast_line = "    return ret;\n"
          last_line    = "}\n\n"
genConstructor' :: String -> [((String, Bool),String)] -> String
genConstructor' name types_names = concat [fst_line, snd_line, concat middle_lines, prelast_line, last_line]
    where fst_line = concat [name, " * new", name,"(", args, "){\n"] 
          args     = concat $ intersperse ", "$ cstructArguments' types_names
          snd_line = concat ["    ",name, " * ret = (",name,"*) malloc(sizeof(",name,"));\n"]
          middle_lines = zipWith (\n1 n2 -> concat ["    ret->",n1," = ",n2, ";\n"])  (map snd types_names) (map accessAsPointer types_names)
          prelast_line = "    return ret;\n"
          last_line    = "}\n\n"
genConstructor' name types_names = concat [fst_line, snd_line, concat middle_lines, prelast_line, last_line]
    where fst_line = concat [name, " * new", name,"(", args, "){\n"] 
          args     = concat $ intersperse ", "$ cstructArguments' types_names
          snd_line = concat ["    ",name, " * ret = (",name,"*) malloc(sizeof(",name,"));\n"]
          middle_lines = zipWith (\n1 n2 -> concat ["    ret->",n1," = ",n2, ";\n"])  (map snd types_names) (map accessAsPointer types_names)
          prelast_line = "    return ret;\n"
          last_line    = "}\n\n"