git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Cosmetic improvement to imports
commitba2cc5cd262cc761c50ab28aadb1bfa288df15c9 authorAndy Arvanitis <andyarvanitis@gmail.com> dateWed 3 Jul 2019, 20:38 (7 years ago) parent348a41a
1 file changed+4−4
src/CodeGen/IL/Printer.hs+4−4
src/CodeGen/IL/Printer.hs+4−4
@@ -402,16 +402,16 @@ 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− (if mn == "Main"
406− then "import \"ffi\"\n"
407− else "") <>
408405 "import (\n" <>
409− (T.concat $ formatImport <$> imports) <> ")\n" <>
406+ (T.concat $ formatImport <$> imports') <> ")\n" <>
410407 "type _ = IGNORE_UNUSED_RUNTIME\n" <>
411408 (if mn == "Main"
412409 then "\ntype _ = ffi.Loader\n\n"
413410 else "\n")
414411 where
412+ imports' :: [Text]
413+ | mn == "Main" = "ffi" : imports
414+ | otherwise = imports
415415 formatImport :: Text -> Text
416416 formatImport s = " \"" <> s <> "\"\n"
417417