Skip to content

runghc does not infer module file extensions

In ghc-6.8 (and possibly earlier), runghc will infer the extension of a module filename if it is not specified at the command line. This feature lets us type, for example, runghc Setup configure without worrying whether there's a Setup.lhs or Setup.hs file present.

For example:

$ cat Useful.hs 
main = putStrLn "Hello, world"
$ runghc Useful
Hello, world

However, this does not work for ghc-6.9.20080824:

$ ~/tmp/ghc-stage/bin/runghc Useful

<no location info>: can't find file: Useful
$ ~/tmp/ghc-stage/bin/runghc Useful.hs
Hello, world
Trac metadata
Trac field Value
Version 6.8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information