@@ -241,8 +241,8 @@ literals = mkPattern' match'
241 , maybe (return mempty) (fmap (emit " else " <>) . prettyPrintCpp') elses
241 , maybe (return mempty) (fmap (emit " else " <>) . prettyPrintCpp') elses
244− t | Left _ <- n = "int"
244+ t | Left _ <- n = int
245− | Right _ <- n = "double"
245+ | Right _ <- n = float
247 match (IfElse _ cond thens elses) = mconcat <$> sequence
247 match (IfElse _ cond thens elses) = mconcat <$> sequence
248 [ return $ emit "if ("
248 [ return $ emit "if ("
@@ -403,11 +403,11 @@ unboxType :: Text -> Maybe Text
403unboxType t
403unboxType t
404 | t == C.semiringInt ||
404 | t == C.semiringInt ||
405 t == C.ringInt
405 t == C.ringInt
406− = Just "int"
406+ = Just int
407 | t == C.semiringNumber ||
407 | t == C.semiringNumber ||
408 t == C.ringNumber ||
408 t == C.ringNumber ||
409 t == C.euclideanRingNumber
409 t == C.euclideanRingNumber
410− = Just "double"
410+ = Just float
411 | otherwise = Nothing
411 | otherwise = Nothing
413renderOp :: Text -> Text
413renderOp :: Text -> Text
@@ -452,7 +452,7 @@ implFooterSource :: Text -> [Ident] -> Text
452implFooterSource mn foreigns =
452implFooterSource mn foreigns =
453 "\n\n" <>
453 "\n\n" <>
454 (if null foreigns then "" else ("auto " <> foreignDict <> "() -> " <> dictType <> "& {\n" <>
454 (if null foreigns then "" else ("auto " <> foreignDict <> "() -> " <> dictType <> "& {\n" <>
455− " static dict_t _dict_;\n" <>
455+ " static " <> dictType <> " _dict_;\n" <>
456 " return _dict_;\n" <>
456 " return _dict_;\n" <>
457 "}\n\n")) <>
457 "}\n\n")) <>
458 "} // end namespace " <> mn <>
458 "} // end namespace " <> mn <>
@@ -470,6 +470,12 @@ implFooterSource mn foreigns =
470dictType :: Text
470dictType :: Text
471dictType = "dict_t"
471dictType = "dict_t"
473foreignDict :: Text
479foreignDict :: Text
474foreignDict = "_foreign_"
480foreignDict = "_foreign_"