git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Simpler ffi package loading
commit7ac14e106b03d6295355e028f4ff076f2547a699 authorAndy Arvanitis <andyarvanitis@gmail.com> dateThu 4 Jul 2019, 12:37 (7 years ago) parent91a535d
1 file changed+5−8
src/CodeGen/IL/Printer.hs+5−8
src/CodeGen/IL/Printer.hs+5−8
@@ -402,16 +402,13 @@ implHeaderSource mn imports _ =
402402 "// Code generated by psgo. DO NOT EDIT.\n\n" <>
403403 "package " <> (if mn == "Main" then "main" else mn) <> "\n\n" <>
404404 "import . \"purescript\"\n" <>
405− "import (\n" <>
406− (T.concat $ formatImport <$> imports') <> ")\n" <>
407− "type _ = IGNORE_UNUSED_RUNTIME\n" <>
408405 (if mn == "Main"
409− then "\ntype _ = ffi.Loader\n\n"
410− else "\n")
406+ then "import _ \"ffi\"\n"
407+ else "\n") <>
408+ "import (\n" <>
409+ (T.concat $ formatImport <$> imports) <> ")\n\n" <>
410+ "type _ = IGNORE_UNUSED_RUNTIME\n\n"
411411 where
412− imports' :: [Text]
413− | mn == "Main" = "ffi" : imports
414− | otherwise = imports
415412 formatImport :: Text -> Text
416413 formatImport s = " \"" <> s <> "\"\n"
417414