Why does --make only allow one module?
ghc --make would be wonderful for UniForM, which at the moment consists of a large selection of libraries, were it not for the restriction that ghc --make insists on only having one module as an argument. Er why? At this rate I shall be driven to writing an otherwise useless module which imports all the modules in each directory, since ghc --make does indeed look a lot faster than compiling each module individually. (In particular, we win big here, I think because the NFS system is very inefficient and makes reading all the .hi files very expensive.) Actually I'd like to just give ghc --make a list of ALL the source files and let it figure out the dependencies. This could also include object files (compiled from C) which were to be linked in, for example. ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[ghci] Comparison with Hugs
In Hugs I can throw some definitions into a file and load it on the shell command line or using :l in Hugs. ghci however will complain that main is missing and even won't keep the defined functions in scope. Is there anything I can do about that? It even doesn't invoke main if it's present. I could hack ghci do add main = print 1 in case main is undefined, but that's not really something I'd like to admit afterwards... -- Abstrakte Syntaxträume. Volker Stolz * [EMAIL PROTECTED] * PGP + S/MIME ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [ghci] Comparison with Hugs
Tue, 24 Apr 2001 16:19:21 +0200, Volker Stolz [EMAIL PROTECTED] pisze: ghci however will complain that main is missing and even won't keep the defined functions in scope. Is there anything I can do about that? Add 'module Foo where' at the top of the file (preferably with the module name matching the filename). -- __( Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTÊPCZA QRCZAK ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: -optCrts-M28m
| 2. I applied -optCrts-G3 -optCrts-F1.5 -optCrts-M28m | | to compile certain large module on 32Mb RAM machine. | Now, what to apply for this with ghc-5.00 ? +RTS -G3 -F1.5 -M28m -RTS J ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
HINSTANCE from main()
Axel - While browising FAQs and message boards I found a question you had posted a few months ago. I decided to write you in case you had not learned the answer yet. (I remember this answer was pretty tough to find when I needed it!) === Hi all, I tried to write a Win32 program in with GHC 4.05 but I am stumbeling over the definition type WNDCLASS = (ClassStyle, -- style HINSTANCE, -- hInstance MbHICON, -- hIcon MbHCURSOR, -- hCursor MbHBRUSH,-- hbrBackground MbLPCSTR,-- lpszMenuName ClassName) -- lpszClassName which looks fine if I'd knew where to get hInstance. main doesn't give it to me. Can specify something like winMain hInstance ... = as my main program entry? Or a more sensible question: Is there any userguide on how to use the Win32 library? Cheers, Axel. === You can get a handle to the current instance of your app in one of 2 ways that I am aware of... 1) You can replace your main() with WinMain (defined below) in which case windows will pass you the instance, and you can either pass it into other functions or use it directly int WINAPI WinMain( HINSTANCE hInstance, // handle to current instance HINSTANCE hPrevInstance, // handle to previous instance LPSTR lpCmdLine, // pointer to command line int nCmdShow // show state of window ); OR 2) you can call GetModuleHandle (defined below) and pass in NULL for the lpModuleName and cast the resulting HMODULE into a HINSTANCE as shown below HMODULE GetModuleHandle( LPCTSTR lpModuleName // address of module name to return handle for ); To Use: HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL); Good luck! Vince ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-make
Hello, I have two questions on ghc-5.00 -make. The User's Guide says in Section 4.5 that it is simpler to use -make than the Makefile technique. 1. I try ghc -make Main.hs with Main.hs containing main = putStr hello\n (in ghc-5.00, binary, i386-unknown, Linux), and it reports ghc-5.00: unrecognised flag: -make - ? 2. How to simplify (eliminate?) Makefile. - My project has many .hs files in the directories ./source/ ./source/auxil/ ./source/pol/factor/ ... `make ...' compiles them putting .hi, .o files into ./export/, then, applies `ar' to make .a library. To do all this, Makefile includes the rules like .hs.o: $(HC) -c $ $(HCFlags) and applies the compiler $(HC) with the flags ... -syslib data -recomp ... -i$(E) -odir $(E) -ohi $(E)/$(notdir $*).hi $($*_flags) ... Now, this Makefile does not work under ghc-5.00, because second compilation cannot find .hi file of the first compilation: ..ghc -c source/auxil/Prelude_.hs -fglasgow-exts ... -recomp -iexport -odir export -ohiexport/Prelude_.hi +RTS -G3 -F1.5 -M29m -RTS -Onot ... ..ghc -c source/parse/Iparse_.hs -fglasgow-exts ... -recomp -iexport -odir export -ohiexport/Iparse_.hi +RTS -G3 -F1.5 -M29m -RTS -Onot source/parse/Iparse_.hs:20: failed to load interface for `Prelude_': Bad interface file: export/Iparse_.hi does not exist Also what -make can do to replace some large part of Makefile. For (a) Makefile has rather odd language, it is not good to force the functional programmer to look into it, (b) one has to think of Makefile versions for different operation systems. Thank you in advance for the help. - Serge Mechveliani [EMAIL PROTECTED] ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users