Now ":load M" always searches for a module called "M", rather than
using a file called "M.hs" if that exists. To get the file semantics
(i.e. not loading "M.o"), use ":load M.hs".
guessTarget file Nothing
| isHaskellSrcFilename file
= return (Target (TargetFile file Nothing) Nothing)
+ | looksLikeModuleName file
+ = return (Target (TargetModule (mkModuleName file)) Nothing)
| otherwise
= do exists <- doesFileExist hs_file
if exists
if exists
then return (Target (TargetFile lhs_file Nothing) Nothing)
else do
- return (Target (TargetModule (mkModuleName file)) Nothing)
+ throwDyn (ProgramError (showSDoc $
+ text "target" <+> quotes (text file) <+>
+ text "is not a module name or a source file"))
where
hs_file = file <.> "hs"
lhs_file = file <.> "lhs"