RE: replacing the Prelude (again)
|Ambiguities in the class Num are most common, so Haskell | provides another |way to resolve them---with a default declaration: |default (t1 , ... , tn) |where n=0, and each ti must be a monotype for which Num ti holds. | ^^ |In situations where an ambiguous type is discovered, an | ambiguous type |variable is defaultable if at least one of its classes is | a numeric class |(that is, Num or a subclass of Num) and if all of its | classes are defined | ^ |in the Prelude or a standard library | ^ |Each defaultable variable is replaced by the first type in | the default list |that is an instance of all the ambiguous variable's | classes. It is a |static error if no such type is found. | | Do these become whatever Num is in scope when I use | -fno-implicit-prelude, and whatever classes from standard | libraries are in scope? If they don't then I think I'm in a pickle. I confess that I had forgotten about this. It's not easy to see what a good alternative design would be... I suppose it could be whatever Num is in scope or a subclass thereof, but what would correspond to defined in the Prelude or a standard lib? An alternative would be to drop the rule altogether with -fno-implicit-prelude and let all ambiguous types be defaulted with the specified list of types. The motivation for the rules as stated is to avoid excessive defaulting, which silently affects the meaning of your program. As you say, the absence of an obvious design point means I'm unlikely to fiddle just now. If a consensus emerges (and it's not to hard to do) I'd be willing to fiddle, though. Simon ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: package name mismatch
It must have been only a warning in 5.02.3, or I could never have compiled it there. (Before 5.02.3 we didn't use the package system like this at all.) Actually I would like this message to go away altogether in this case, if possible. The actual situation is that GetPut.hs is in fact part of the package uni-events-test, and the compiler is told to load uni-events-test on the command line. However GetPut.hs is *also* in the current directory during this compilation, so GHC loads it from there instead. I'm not sure what logic would be best here, but my suggestion would be that where a .hi file is found in an import declaration and has an unexpected package name, GHC keeps on searching. If it finds a .hi file with a matching package name, it accepts it, otherwise accept the .hi file with the wrong package name and issue a warning. If that's too complicated, just ignore .hi files with the wrong package name. But then people might complain . . . I think this is all way too complicated. GHC's view of modules is fairly simple: they either reside in the home package or another package. If a module occurs in both, then previously it was an error, now it is just a warning. If we were using packages for dynamic libraries, one of the reasons we originally added packages, then it really *would* be an error and you'd be in trouble if you did this! Can't you just fix your build so that the situation doesn't occur? Cheers, Simon ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
new RTS interface problem with ghc-5.04
I have just moved to ghc-5.04 to try the threaded runtime, however some code I have to do dynaminc module loading using the rts linker will not compile, failing with: RtsAPIDeprec.o undefined reference to Addr_Azh_con_info (in rts_mkAddr) this symbol appears to be defined in libHSlang.a, and I have a -syslib lang in the compile command... what's wrong here? secondly, if this interface is deprecated, (I presume this is something to do with the FFI?) where am I using rts_mkAddr and rts_getAddr, would that be in addrToHValue, and if so what is the non-deprecated way of doing this? Keean Schupke Department of Electrical Electronic Engineering, Imperial College. ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: package name mismatch
Simon Marlow wrote: [snip] Can't you just fix your build so that the situation doesn't occur? [snip] Grumble. Yes, I suppose so. I hate being an implementor instead of a bug-reporter. ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: Unregisterised build
Hi, [...] BTW the cross-port script is a little old, so you might find other problems. As far as I know, unregisterised compilation *does* work though. I had to do a number of manual compiles, out-of-order makes etc. to get stuff working; I'm not completely convinced that what I'm trying to do is right ATM... [...] Your best bet for the .hsc files is to generate the .hs on your Alpha/Linux box by taking the intermediate _hsc.c files over and compiling/running them on the target machine to get the .hs files. Then take the .hs back to the bootstrapping machine and carry on. These are the libraries in stage 1, BTW. Did that. [...] The cross-port script also tries to do too much. You won't be able to actually run the b2 compiler on your bootstrap box, because it will be built against the Alpha/Linux-specific libraries, so just stop after you've got a set of .hc files for ghc/compiler in stage 2. Take the library .hc files from stage 1, and the compiler .hc files from stage 2, to your Alpha/Linux box. That's where I am now. Running the distrib/hc-build script dies pretty early on in the ghc subdir: ... copying ./mpn/generic/sb_divrem_mn.c to mpn/sb_divrem_mn.c copying ./mpn/generic/jacbase.c to mpn/jacbase.c copying ./mpn/alpha/gmp-mparam.h to gmp-mparam.h ../utils/ghc-pkg/ghc-pkg-inplace --update-package rts.conf.inplace /bin/sh: ../utils/ghc-pkg/ghc-pkg-inplace: No such file or directory make[1]: *** [boot] Error 127 I tried building that manually, but it seems to be relying on the presence of a large amount of libraries (I have all its object files, but they're worthless without the libs). 'make' in ghc/compiler dies with: gcc -x c absCSyn/AbsCSyn.hc -o absCSyn/AbsCSyn.raw_s -S -O -mieee -static -w -D__GLASGOW_HASKELL__=505 -O -I/home/jameson/work/port/haskell/build/ghc/includes -I/home/jameson/work/port/haskell/build/libraries/base/include -I/home/jameson/work/port/haskell/build/hslibs/lang/cbits -I/home/jameson/work/port/haskell/build/hslibs/posix/cbits -I/home/jameson/work/port/haskell/build/hslibs/util/cbits -I/home/jameson/work/port/haskell/build/hslibs/text/cbits -I/home/jameson/work/port/haskell/build/hslibs/hssource/cbits -Iparser -I. -I../includes -O -D__GLASGOW_HASKELL__=505-I. `echo | sed 's/^$/-DSTOLEN_X86_REGS=4/'` absCSyn/AbsCSyn.hc:2: HsStd.h: No such file or directory absCSyn/AbsCSyn.hc:46: macro `SET_HDR_' used with only 3 args absCSyn/AbsCSyn.hc:174: macro `SET_HDR_' used with only 3 args [...] followed by more of the same. The only fitting SET_HDR_ seems to be in common-rts/includes/StgMacros.h. I'm not sure which of the two approaches I should pursue now and where to look for solutions to these problems (HsStd.h in particular managed to evade all attempts to find(1) it); any ideas or suggestions? At some point we'll try to make all this easier, but I'm afraid that's the way it is at the moment :-( NP, it's quite interesting (in a masochistic kind of way ;) Thanks for your help so far, llap, Christoph ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
System.system broken?
is System.system broken in 5.04? i am using the rpm provided on the web site and this call appears to be broken. in particular, using strace i find that it is attempting the following call [pid 16975] execve(n/sh, [/bin/sh, -c, echo foo], [/* 67 vars */]) = -1 ENOENT (No such file or directory) note that it appears the first three characters are being droped from the first argument to execve. John -- --- John Meacham - California Institute of Technology, Alum. - [EMAIL PROTECTED] --- ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users