@@ -169,7 +169,7 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
169 return (CppComment com fn)
169 return (CppComment com fn)
171 ty' | Just t <- ty = Just t
171 ty' | Just t <- ty = Just t
172− | Just (t, _, _) <- M.lookup (mn, ident) (E.names env) = Just t
172+ | Just (t, _, _) <- M.lookup (Qualified (Just mn) ident) (E.names env) = Just t
173 | otherwise = Nothing
173 | otherwise = Nothing
174 argcnt = maybe 0 countArgs ty'
174 argcnt = maybe 0 countArgs ty'
175 name = identToCpp ident
175 name = identToCpp ident
@@ -484,7 +484,7 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
484 return $ foldl (\fn a -> CppApp fn [a]) fn' curriedArgs
484 return $ foldl (\fn a -> CppApp fn [a]) fn' curriedArgs
486 ty | (_, _, Just t, _) <- ann = Just t
486 ty | (_, _, Just t, _) <- ann = Just t
487− | Just (t, _, _) <- M.lookup (mn', ident) (E.names env) = Just t
487+ | Just (t, _, _) <- M.lookup (Qualified (Just mn') ident) (E.names env) = Just t
488 | otherwise = Nothing
488 | otherwise = Nothing
490 flip (foldl (\fn a -> CppApp fn [a])) args' <$> valueToCpp f
490 flip (foldl (\fn a -> CppApp fn [a])) args' <$> valueToCpp f
@@ -810,8 +810,8 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
810 go _ = return []
810 go _ = return []
812 allForeigns :: [(Ident, T.Type)]
812 allForeigns :: [(Ident, T.Type)]
813− allForeigns = map (\((_, ident), (ty, _, _)) -> (ident, ty)) .
813+ allForeigns = map (\((Qualified _ ident), (ty, _, _)) -> (ident, ty)) .
814− filter (\((mn', _), (_, kind, _)) -> mn' == mn && kind == E.External) .
814+ filter (\((Qualified mn' _), (_, kind, _)) -> mn' == Just mn && kind == E.External) .
815 M.toList $ E.names env
815 M.toList $ E.names env
817---------------------------------------------------------------------------------------------------
817---------------------------------------------------------------------------------------------------