- if null leftovers
- then return ()
- else putStrLn $ "Domain " ++
- (show d) ++
- " delegates somewhere else: " ++
- (join " " (map show leftovers))
-
-clean :: Delegates -> (Domain, Maybe [Domain]) -> (Domain, Maybe [Domain])
+ unless (null leftovers) $
+ putStrLn $ "Domain " ++
+ (show d) ++
+ " delegates somewhere else: " ++
+ (join " " (map show leftovers))
+
+
+-- | "Clean" a lookup result by subtracting out the list of delegates.
+-- There shouldn't be anything left over. If there were no lookup
+-- results, we leave the Nothing in place so that 'report' can
+-- pattern match on it.
+clean :: [Domain] -- ^ List of delegates, @ds@
+ -> LookupResult
+ -> LookupResult