diff --git a/fficxx/lib/FFICXX/Generate/Builder.hs b/fficxx/lib/FFICXX/Generate/Builder.hs index 2c4460ca..18920fa2 100644 --- a/fficxx/lib/FFICXX/Generate/Builder.hs +++ b/fficxx/lib/FFICXX/Generate/Builder.hs @@ -124,6 +124,7 @@ simpleBuilder topLevelMod mumap (cabal,classes,toplevelfunctions,templates) extr -- + -- TODO: Template.hs-boot need to be generated as well putStrLn "hs-boot file generation" mapM_ (\m -> gen (m <.> "Interface" <.> "hs-boot") (prettyPrint (buildInterfaceHSBOOT m))) hsbootlst -- diff --git a/fficxx/lib/FFICXX/Generate/Code/HsFrontEnd.hs b/fficxx/lib/FFICXX/Generate/Code/HsFrontEnd.hs index e279eb17..e4ad6aff 100644 --- a/fficxx/lib/FFICXX/Generate/Code/HsFrontEnd.hs +++ b/fficxx/lib/FFICXX/Generate/Code/HsFrontEnd.hs @@ -268,9 +268,23 @@ genImportInInterface m = modlstparent = cmImportedModulesHighNonSource m modlsthigh = cmImportedModulesHighSource m in [mkImport (cmModule m <.> "RawType")] - <> map (\case Left t -> mkImport (getTClassModuleBase t <.> "Template"); Right c -> mkImport (getClassModuleBase c <.>"RawType")) modlstraw - <> map (\case Left t -> mkImport (getTClassModuleBase t <.> "Template"); Right c -> mkImport (getClassModuleBase c <.>"Interface")) modlstparent - <> map (\case Left t -> mkImportSrc (getTClassModuleBase t <.> "Template"); Right c -> mkImportSrc (getClassModuleBase c<.>"Interface")) modlsthigh + <> flip map modlstraw + (\case + Left t -> mkImport (getTClassModuleBase t <.> "Template") + Right c -> mkImport (getClassModuleBase c <.>"RawType") + ) + <> flip map modlstparent + (\case + Left t -> mkImport (getTClassModuleBase t <.> "Template") + Right c -> mkImport (getClassModuleBase c <.>"Interface") + ) + <> flip map modlsthigh + (\case + Left t -> -- TODO: *.Template in the same package needs to have hs-boot. + -- Currently, we do not have it yet. + mkImport (getTClassModuleBase t <.> "Template") + Right c -> mkImportSrc (getClassModuleBase c<.>"Interface") + ) -- | genImportInCast :: ClassModule -> [ImportDecl ()]