git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Cosmetic improvement to imports
ba2cc5cAndy Arvanitis
src/CodeGen/IL/Printer.hs+4−4
@@ -402,16 +402,16 @@ implHeaderSource mn imports _ =
402 "// Code generated by psgo. DO NOT EDIT.\n\n" <>
402 "// Code generated by psgo. DO NOT EDIT.\n\n" <>
403 "package " <> (if mn == "Main" then "main" else mn) <> "\n\n" <>
403 "package " <> (if mn == "Main" then "main" else mn) <> "\n\n" <>
404 "import . \"purescript\"\n" <>
404 "import . \"purescript\"\n" <>
405− (if mn == "Main"
406− then "import \"ffi\"\n"
407− else "") <>
408 "import (\n" <>
405 "import (\n" <>
409− (T.concat $ formatImport <$> imports) <> ")\n" <>
406+ (T.concat $ formatImport <$> imports') <> ")\n" <>
410 "type _ = IGNORE_UNUSED_RUNTIME\n" <>
407 "type _ = IGNORE_UNUSED_RUNTIME\n" <>
411 (if mn == "Main"
408 (if mn == "Main"
412 then "\ntype _ = ffi.Loader\n\n"
409 then "\ntype _ = ffi.Loader\n\n"
413 else "\n")
410 else "\n")
414 where
411 where
412+ imports' :: [Text]
413+ | mn == "Main" = "ffi" : imports
414+ | otherwise = imports
415 formatImport :: Text -> Text
415 formatImport :: Text -> Text
416 formatImport s = " \"" <> s <> "\"\n"
416 formatImport s = " \"" <> s <> "\"\n"
417
417