The Haskell report says that, by convention, only _HASKELL_ files have a
.hs or .lhs extension.

------http://www.haskell.org/onlinereport/literate.html----------
        By convention, the style of comment is indicated by the file extension,
        with ".hs" indicating a usual Haskell file and ".lhs"
        indicating a literate Haskell file
------------------------------

It is always a surprise when you try to load a .hs or .lhs file in
hugs and discover that it really requires cpp.  

Either, cpp (or some preprocessor standard), should be made part of the
Haskell language definition or Haskell files that require a preprocessor
should have a different extension.  

Since, I assume that the hugs team has a good reason not to build in cpp
functionality, I am suggesting that Haskell files with preprocessor
directives have the extension .hs.cpp

One could argue that Hugs is actualy more flexible because it supports any
arbitrary preprocessor, but the substantive issue is that running each
imported script through python & cpp adds substantial load time.  This
load time is much less acceptable in an interpreted environment, than in
the compile time environment of GHC. In this environment, it is much
better to "compile" .hs.cpp files into .hs files before runtime.  

In the case of Xtract, we are renaming all the files to .hs.cpp,
generating a clean set of .hs files, and then running hugs.  The
alternative is just too slow.

-Alex-

___________________________________________________________________
S. Alexander Jacobson                   Shop.Com
1-212-697-0184 voice                    The Easiest Way To Shop





Reply via email to