2

On this page:

http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours/Parsing

it shows ghc being called thusly:

ghc -package parsec -o simple_parser [../code/listing3.4.hs listing3.4.hs]

What are the square brackets for? I get an error with I use it with ghc 7.0.4. Is this some sort of way to specify a search path for input files?

ErikR
  • 51,541
  • 9
  • 73
  • 124

1 Answers1

9

GHC doesn't accept any such command-line syntax; to compile listing3.4.hs, you should use:

ghc -o simple_parser listing3.4.hs

(You don't have to specify packages these days; GHC will automatically link them in as required.)

This is a wiki markup mistake, caused by an automatic conversion of the original Write Yourself a Scheme in 48 Hours to wiki format. On this page, you can see that in the corresponding code block, listing3.1.hs is linked to a copy of the file. This relative link was converted to the MediaWiki external link syntax, which, of course, does not work inside code blocks. (Even if it did, a relative path is used, so it wouldn't link anywhere useful.)

ehird
  • 40,602
  • 3
  • 180
  • 182