-haskellish_file = haskellish_suffix . getFileSuffix
-haskellish_src_file = haskellish_src_suffix . getFileSuffix
-cish_file = cish_suffix . getFileSuffix
-objish_file = objish_suffix . getFileSuffix
+#ifdef mingw32_TARGET_OS
+dynlib_suffixes = ["dll", "DLL"]
+#elif defined(darwin_TARGET_OS)
+dynlib_suffixes = ["dylib"]
+#else
+dynlib_suffixes = ["so"]
+#endif
+
+isHaskellishFilename f = getFileSuffix f `elem` haskellish_suffixes
+isHaskellSrcFilename f = getFileSuffix f `elem` haskellish_src_suffixes
+isCishFilename f = getFileSuffix f `elem` cish_suffixes
+isExtCoreFilename f = getFileSuffix f `elem` extcoreish_suffixes
+isObjectFilename f = getFileSuffix f `elem` objish_suffixes
+isHaskellUserSrcFilename f = getFileSuffix f `elem` haskellish_user_src_suffixes
+isDynLibFilename f = getFileSuffix f `elem` dynlib_suffixes
+
+isSourceFilename :: FilePath -> Bool
+isSourceFilename f =
+ isHaskellishFilename f ||
+ isCishFilename f