- }
- -- The is_explicit field is True iff the thing was named
- -- *explicitly* in the import specs rather
- -- than being imported as part of a "..." group
- -- e.g. import C( T(..) )
- -- Here the constructors of T are not named explicitly;
- -- only T is named explicitly.
+ } -- ^ The import had an import list.
+ -- The 'is_explicit' field is @True@ iff the thing was named
+ -- /explicitly/ in the import specs rather
+ -- than being imported as part of a "..." group. Consider:
+ --
+ -- > import C( T(..) )
+ --
+ -- Here the constructors of @T@ are not named explicitly;
+ -- only @T@ is named explicitly.
+
+unQualSpecOK :: ImportSpec -> Bool
+-- ^ Is in scope unqualified?
+unQualSpecOK is = not (is_qual (is_decl is))
+
+qualSpecOK :: ModuleName -> ImportSpec -> Bool
+-- ^ Is in scope qualified with the given module?
+qualSpecOK mod is = mod == is_as (is_decl is)