@@ -214,11 +214,10 @@ resolveImports env (Module currentModule decls) = ImportEnvironment
214214 (ModuleName, S.Set ProperName) ->
215215 Either String (M.Map ProperName (Qualified ProperName))
216216 resolveDefs filt result (mn, names) = case M.lookup mn scope of
217− Just Nothing -> foldM (resolveDef mn) result (S.toList names)
218− Just (Just expl) -> do
219− forM_ (filt expl) $ \name ->
220− unless (name `S.member` names) $ Left $ runProperName name ++ " is explicitly imported but not defined"
221− foldM (resolveDef mn) result (S.toList names `intersect` filt expl)
217+ Just maybeExpl -> foldM (resolveDef mn) result $
218+ case maybeExpl of
219+ Just expl -> S.toList names `intersect` filt expl
220+ Nothing -> S.toList names
222221 Nothing -> Right result
223222
224223 -- Resolve a set of data constructors keyed by their type constructor
@@ -226,9 +225,8 @@ resolveImports env (Module currentModule decls) = ImportEnvironment
226225 (ModuleName, S.Set (ProperName, [ProperName])) ->
227226 Either String (M.Map ProperName (Qualified ProperName))
228227 resolveDcons result (mn, tcons) = case M.lookup mn scope of
229− Just Nothing -> foldM (foldM $ resolveDef mn) result (snd `map` S.toList tcons)
230− Just (Just expl) -> foldM (foldM $ resolveDef mn) result (snd `map` selectedTcons)
231− where
232− selectedTcons = filter ((`elem` explTypeImports) . fst) (S.toList tcons)
233− explTypeImports = typeImports expl
228+ Just maybeExpl -> foldM (foldM $ resolveDef mn) result $ map snd $
229+ case maybeExpl of
230+ Just expl -> filter ((`elem` typeImports expl) . fst) (S.toList tcons)
231+ Nothing -> S.toList tcons
234232 Nothing -> Right result