@@ -63,7 +63,7 @@ moduleToIL (Module _ coms mn _ imps _ foreigns decls) _ =
6363 optimized <- traverse (traverse (optimize modName')) ilDecls
6464 let optimized' = concat optimized
6565 values = annotValue <$> optimized'
66− foreigns' = identToIL <$> foreigns
66+ foreigns' = moduleIdentToIL <$> foreigns
6767 interface = interfaceSource modName values foreigns
6868 implHeader = implHeaderSource modName (imports ++ ignoredImports) interfaceImport
6969 implFooter = implFooterSource modName foreigns
@@ -204,18 +204,6 @@ moduleToIL (Module _ coms mn _ imps _ foreigns decls) _ =
204204 unApp :: Expr Ann -> [Expr Ann] -> (Expr Ann, [Expr Ann])
205205 unApp (App _ val arg) args = unApp val (arg : args)
206206 unApp other args = (other, args)
207− -- valueToIL (Var (_, _, _, Just IsForeign) qi@(Qualified (Just mn') ident)) =
208− -- return $ if mn' == mn
209− -- then AST.Var Nothing (moduleNameToIL mn' <> "::" <> identToIL ident)
210− -- else varToIL qi
211− -- valueToIL (Var (_, _, _, Just IsForeign) (Qualified (Just mn') ident)) =
212− -- return $ AST.Var Nothing (moduleNameToIL mn' <> "::" <> identToIL ident)
213− -- valueToIL (Var (_, _, _, Just IsForeign) qi@(Qualified (Just mn') ident)) =
214− -- return $ if mn' == mn
215− -- then foreignIdent ident
216− -- else varToIL qi
217− -- valueToIL (Var (_, _, _, Just IsForeign) ident) =
218− -- internalError $ "Encountered an unqualified reference to a foreign ident " ++ T.unpack (showQualified showIdent ident)
219207 valueToIL (Var _ ident) = return $ varToIL ident
220208 valueToIL (Case (ss, _, _, _) values binders) = do
221209 vals <- mapM valueToIL values