@@ -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