\section[Finder]{Module Finder}
\begin{code}
+{-# OPTIONS -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+-- http://hackage.haskell.org/trac/ghc/wiki/CodingStyle#Warnings
+-- for details
+
module Finder (
flushFinderCaches,
FindResult(..),
import UniqFM
import Maybes ( expectJust )
-import DATA_IOREF ( IORef, writeIORef, readIORef, modifyIORef )
-
+import Data.IORef ( IORef, writeIORef, readIORef, modifyIORef )
import Data.List
import System.Directory
import System.IO
import Control.Monad
-import Time ( ClockTime )
+import System.Time ( ClockTime )
type FileExt = String -- Filename extension
exts | isOneShot (ghcMode dflags) = hi_exts
| otherwise = source_exts
in
+
+ -- special case for GHC.Prim; we won't find it in the filesystem.
+ -- This is important only when compiling the base package (where GHC.Prim
+ -- is a home module).
+ if mod == gHC_PRIM
+ then return (Found (error "GHC.Prim ModLocation") mod)
+ else
+
searchPathExts home_path mod exts