GHC 5.02.2: ghci type-reporting error
I get the following error when asking for the type of `build' in ghci, 5.02.2. This still happens, with or without -fglasgow-exts. astrocyte:compiler$ ghci ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 5.02.2, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \/\/ /_/\/|_| Type :? for help. Loading package std ... linking ... done. Prelude :t PrelBase.build Illegal use of `PrelBase.build' It is applied to too few arguments so that the result type has for-alls in it: (forall b. (a - b - b) - b - b) - [a] Prelude --KW 8-) -- Keith Wansbrough [EMAIL PROTECTED] http://www.cl.cam.ac.uk/users/kw217/ University of Cambridge Computer Laboratory. ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
ghci --help not helpful
Hi... when I type ghci --help, I get the help for the compiler, not the interpreter. Perhaps the docs could be changed? Also, I'd like an analogue of hugs' `runhugs', that automatically invokes `main', and then exits when that completes. --KW 8-) -- Keith Wansbrough [EMAIL PROTECTED] http://www.cl.cam.ac.uk/users/kw217/ University of Cambridge Computer Laboratory. ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: Exists for all places
Arthur Baars asks: It there a reason why existential quantification does not work with a newtype, or is it just a parser problem? From the manual, section 7.12.3 Restrictions: --8-- You can't use existential quantification for newtype declarations. So this is illegal: newtype T = forall a. Ord a = MkT a Reason: a value of type T must be represented as a pair of a dictionary for Ord t and a value of type t. That contradicts the idea that newtype should have no concrete representation. You can get just the same efficiency and effect by using data instead of newtype. If there is no overloading involved, then there is more of a case for allowing an existentially-quantified newtype, because the data because the data version does carry an implementation cost, but single-field existentially quantified constructors aren't much use. So the simple restriction (no existential stuff on newtype) stands, unless there are convincing reasons to change it. --8-- HTH. --KW 8-) ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: hGetContents bug?
I'll get a strange result if the file contains the character 1A-hexadecimal (or 26-decimal): all characters beyond this point won't be printed on the screen. I think this is correct behaviour for a text file under Windows/DOS... you should open the file as binary instead. --KW 8-) ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: message
[This message is sent through a WWW-Email gateway.] [The authenticity of the sender can not be validated.] [Message sent from the following machine webproxy.dana.com - 162.74.52.180 ] [after accessing this URL http://www.dcs.gla.ac.uk/scripts/global/send_message?[EMAIL PROTECTED]+message] -- After I close all programs and shut down the computer, I get the following error during the shut down process. [..] Have we ever had a real bug report via this Web interface? Could it perhaps be removed, O maintainer of the list? --KW 8-) ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: False duplicate or overlapping instances message
Instances.hs:1: Duplicate or overlapping instance declarations for `HasConfig (arcTypeConfig value) (arcTypeParms value)' defined at Instances.hs:19 and defined at Instances.hs:11 This is not fair, because while the instances for HasConfig have the potential to conflict in the future, they will only do so should the classes NodeTypeConfigParms and ArcTypeConfigParms overlap. It is fair. Let's rename your type variables to make what's going on a little clearer: main = return () class HasConfig a b where ($$) :: a - b - b class NodeTypeConfigParms a b where nodeTypeConfig :: a c - b c - b c instance (NodeTypeConfigParms a b) = HasConfig (a c) (b c) where ($$) = nodeTypeConfig class ArcTypeConfigParms a b where arcTypeConfig :: a c - b c - b c instance (ArcTypeConfigParms a b) = HasConfig (a c) (b c) where ($$) = arcTypeConfig You can now see that the two instance declarations overlap: their right hand sides are in fact *identical*. Remember that the typechecker simply matches on the right-hand sides ("heads") of the instance declarations. If you do -fallow-undecidable-instances, I think your program will work (in the Prolog-ish backtracking way), but note that if NodeTypeConfigParms and ArcTypeConfigParms are ever given instances at the same pair of types, the value of ($$) will be undefined. --KW 8-) ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: Addition to Position of p_hi-files for Profiling under Windo
Andreas Marth writes: I just gave up with compiling for profiling because the ld complained: "cannot open -lHSlang_p_imp: No such file or directory". Any solution available? In the Windows install, the files are currently put in the wrong place. A fix is to simply move the contents of imports/* to lib/imports/* ; presumably the library files have to move appropriately too. The profiling files live in the same directories as the normal files, and are distinguished simply by their names. Reuben is working on this as we speak. InstallShield has a particularly horrible interface for fixing this kind of problem, unfortunately. HTH. --KW 8-) for the GHC team.
Re: pre-4.07 inherits bug from 4.06
main = let xs = [((1,[0,0,0,0,2,0,0,0,0,2]),(-5,[0,0,0,0,1,0,3,3,0,1])), [..] It hangs afterghc -c Main.hs; ghc -o run Main.o; ./run Thanks for the report; actually we know this bug is still there. It turns out that there's no easy fix, and it's pretty tiresome to fix it properly. The workaround remains: compile with -O. Reuben: could you mention this one in the mini-FAQ as a known bug? For the record: This is the same bug that causes certain programs compiled with profiling on to hang. A notable case is in compiling the compiler with profiling; PrimOp.lhs must be compiled with -O to avoid the profiled hsc hanging. --KW 8-)
Re: Glasgow Parallel Haskell
Recently GPH was installed on my Universities beowulf cluster. PVM3 is installed (as well as Lam MPI). Ghc appears to be correctly installed; it compiles non-parallel programs fine. However when I try to compile (for example) the fibonacci function given in the documentation it fails. [..] Given the command: ghc -parallel -O -o p parallelfib.hs The result is: parallelfib.hs:2: Could not find valid interface file `Prelude' It would appear that you don't have the parallel build of the compiler installed properly. GHC is built with one or more `ways'. The normal `way' is the default, but there are also `p' for profiling, `t' for ticky-ticky, and ... `mp' for parallel. When compiling with a `way' other than the normal one, GHC looks for Foo.mp_hi, Foo.mp_o, and so on instead of Foo.hi, Foo.o. So there should a file Prelude.mp_hi in one of the directories GHC is looking through. GHC is complaining that it's not there. HTH. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) ---: : PhD Student, Computer Laboratory, University of Cambridge, UK. : : Native of Antipodean Auckland, New Zealand: 174d47'E, 36d55'S. : : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : ::
Re: cvs 4.07 arithmetic errors in Integer arithmetic
Finally I would like to know if there is a way to get my hands on a cvs tree for 4.06 so that I can compare the two and see what happens when I apply a fix to 4.07 against applying the same fix for 4.06? cvs co -r ghc-4-06-branch will give you the 4.06 tree. cvs diff -r ghc-4-06-branch will give you the diffs between your current tree and ghc 4.06. `ghc-4-06-branch' includes any patches to the released GHC-4.06 since the initial release (eg, ghc-4-04-branch is GHC 4.04 pl1); `ghc-4-06' is the initially-released GHC 4.06. I believe in this case they're the same. HTH. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) ---: : PhD Student, Computer Laboratory, University of Cambridge, UK. : : Native of Antipodean Auckland, New Zealand: 174d47'E, 36d55'S. : : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : ::
RegexString warning
Building latest CVS (with ghc-4.02 on Linux): ../../ghc/driver/ghc-inplace -lbfd -liberty -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing -ihtml -static -DDEBUG -fno-prune-tydecls -O -fno-specialise -syslib lang-c RegexString.lhs -o RegexString.o -osuf o RegexString.lhs:12: Warning: The export item `Regex(..)' suggests that `Regex' has constructor or class methods but it has none; it is a type synonym or abstract type or class ghc: 258175776 bytes, 77 GCs, 1206239/2286332 avg/max bytes residency (5 samples), 7M in use, 0.03 INIT (0.01 elapsed), 9.42 MUT (10.04 elapsed), 2.07 GC (2.14 elapsed) :ghc --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) ---: : PhD Student, Computer Laboratory, University of Cambridge, UK. : : Native of Antipodean Auckland, New Zealand: 174d47'E, 36d55'S. : : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : ::
Re: Eliminate Con
[eliminate Con in favour of Lit] Sounds great to me, I think. I'm currently still on holiday and don't have my code etc here, but I doubt this will cause me big problems. --KW 8-)
CVS repository inaccessible
I seem to be unable to access the CVS tree on glass.cse.ogi.edu. 'cvs update' just hangs. A traceroute seems to show glass to be inaccessible; a straight ssh hangs too. Here's the traceroute info. sphere:kw217$ traceroute glass.cse.ogi.edu traceroute to glass.cse.ogi.edu (129.95.44.145), 30 hops max, 40 byte packets 1 heathrow (128.232.0.1) 1.047 ms 0.953 ms 0.973 ms 2 route-cent-8.cam.ac.uk (192.153.213.197) 1.471 ms 1.298 ms 1.241 ms 3 route-sj3.cam.ac.uk (131.111.2.30) 2.115 ms 5.404 ms 1.871 ms 4 cambridge.london-core.ja.net (146.97.251.49) 5.755 ms 4.985 ms 4.938 ms 5 london.external-gw.ja.net (146.97.251.57) 7.265 ms 5.985 ms 6.845 ms 6 us-gw2.ja.net (128.86.1.242) 6.424 ms 6.998 ms 7.604 ms 7 ny-pop.ja.net (193.62.157.10) 83.117 ms 85.262 ms 79.930 ms 8 if-5-3.core1.NewYork.Teleglobe.net (207.45.202.29) 82.108 ms 86.817 ms 80.301 ms 9 Teleglobe.net (207.45.221.99) 81.460 ms 80.792 ms 79.768 ms 10 ix-1-1-1.bb1.NewYork.Teleglobe.net (207.45.201.138) 82.335 ms 82.357 ms 89.666 ms 11 nyc1-0.nyc2-0.verio.net (129.250.3.130) 89.451 ms 83.746 ms 86.125 ms 12 nyc2.ord2.verio.net (129.250.3.133) 107.696 ms 103.268 ms 105.210 ms 13 ord2.ord0.verio.net (129.250.2.25) 109.754 ms 101.839 ms 101.509 ms 14 ord0.sea2.verio.net (129.250.2.221) 164.112 ms 161.331 ms 159.059 ms 15 p1-1-1-0.r00.ptldor01.us.bb.verio.net (129.250.2.33) 164.160 ms 165.280 ms 163.641 ms 16 pdx20-fe2-0.or.nw.verio.net (129.250.30.150) 168.256 ms 166.121 ms 168.050 ms 17 bea10-hssi0-1-0.or.nw.verio.net (206.163.3.102) 169.567 ms 168.060 ms 166.792 ms 18 ogi-fe0-0-0.bea10.or.nw.verio.net (205.238.22.202) 171.685 ms 182.018 ms 172.139 ms 19 ogi2-gw.ogi.edu (129.95.20.1) 175.282 ms 170.591 ms 180.232 ms 20 * * * 21 * * * 22 * * * 23 * * * 24 * * * 25 * * * 26 * * * 27 * * * 28 * * * 29 * * * I am on sphere.cl.cam.ac.uk (128.232.3.186), which is behind a firewall. 'cvs update -Pd' with [EMAIL PROTECTED]:/home/ cvs/root worked fine for me yesterday. Thanks. --KW 8-)
Re: [module Time] ghc-4.05 time-travelling
| Because if you add a a time interval to a time such that they span a | DST change you would get the wrong result. Whoa! If 'now' is 123456 seconds after midnight on 1 Jan 1970, then 10 seconds later must be 123466 seconds after midnight 1 Jan 1970, regardless of daylight saving time or whatever. Surely! Simon But if 'now' is 1999-10-31 01:59:55 BST, ten seconds later it is 1999-10-31 01:00:05 GMT. And if 'now' is 1999-03-28 00:59:55 GMT, ten seconds later it is 1999-03-28 02:00:05 BST. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-:
Re: -fddump..
sphere:kw217$ cd ~/Own/fptools-4.xx-current/ghc/docs/users_guide/ sphere:users_guide$ cvs diff -r ghc-4-04 -r ghc-4-04-branch glasgow_exts.vsgml Index: glasgow_exts.vsgml === RCS file: /home/cvs/root/fptools/ghc/docs/users_guide/glasgow_exts.vsgml ,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -r1.12 -r1.12.2.1 --- glasgow_exts.vsgml 1999/07/14 11:33:10 1.12 +++ glasgow_exts.vsgml 1999/08/02 09:53:31 1.12.2.1 @@ -1,5 +1,5 @@ % -% $Id: glasgow_exts.vsgml,v 1.12 1999/07/14 11:33:10 simonmar Exp $ +% $Id: glasgow_exts.vsgml,v 1.12.2.1 1999/08/02 09:53:31 simonmar Exp $ % % GHC Language Extensions. % @@ -2127,8 +2127,8 @@ p itemize -item Use @-fddump-rules@ to see what transformation rules GHC is using. -item Use @-fddump-simpl-stats@ to see what rules are being fired. +item Use @-ddump-rules@ to see what transformation rules GHC is using. +item Use @-ddump-simpl-stats@ to see what rules are being fired. item The defintion of (say) @build@ in @PrelBase.lhs@ looks llike this: tscreenverb build :: forall a. (forall b. (a - b - b) - b - b) - [a] sphere:users_guide$ In other words, it's fixed already in patchlevel 1. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-:
Importing in a .hi-boot file
Hi... if I write a .hi-boot(-5) file that imports from another module (in this case to re-export), GHC looks for that module's .hi file. I would prefer it to look for a .hi-boot file. __interface TypeFr 1 0 where __export TypeFr Type Kind SuperKind ; 1 data Type ; 1 type Kind = Type ; 1 type SuperKind = Type ; and __interface Type 1 0 where __export TypeFr Type Kind SuperKind ; Here TypeFr is the friends' interface, which contains the representation details, and Type publishes only the abstract data type. I would like importers to be able to write import {-# SOURCE #-} Type( Type ) (if they are not friends), but at present they must write import {-# SOURCE #-} TypeFr( Type ) Thanks. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-:
Minimal complete definition for Enum
Hi... cf Haskell Report appendix A: class Enum ... -- Minimal complete definition: -- toEnum, fromEnum Glasgow Haskell v4.02: KDBPrim.lhs:40: Warning: No explicit method nor default method for `enumFromThen' in an instance declaration for `Enum' Hmm... this seems to be a bug in the Haskell report too... the definition is missing from the example Prelude. Cc'd to Haskell list. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-:
Re: GHC doesn't understand a .hi file
Line 114 of Window.hi says: 1 zdfHasTextWindow :: __forall [v] {GUIValue.GUIValue v, GUIState.GUIObject Window} = {GUIBaseClasses.HasText Window v} ; ghc --version says The Glorious Glasgow Haskell Compilation System, version 4.03, patchlevel 0 I downloaded it around 18th May from the CVS repository and compiled it for sparc-solaris. On the 11th May the .hi format changed from what you have above, slightly; this shouldn't cause the problem you mention but it does mean that your ghc is older than you think. It should look like this: 1 zdfHasTextWindow :: __forall [v] = {GUIValue.GUIValue v} - {GUIState.GUIObject Window} - {GUIBaseClasses.HasText Window v} ; HTH. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-:
GHC dies with no error message
Probably not repeatable, but in case someone recognises it: In the latest GHC 4.03 from CVS, compiling using ghc-4.02, and with GhcLibHcOpts=-DDEBUG -fno-prune-tydecls -O -fno-specialise, when it gets to lib/exts/Word.lhs it dies with no error message: ==fptools== make all --no-print-directory -r; in /local/scratch/kw217/Builds/i386-unknown-linux/fptools-4.xx-cvs-w402 /ghc/lib/exts ../../../ghc/driver/ghc -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing -DDEBUG -fno-prune-tydecls -O -fno-specialise -static -H12m -monly-3-regs -c Word.lhs -o Word.o -osuf o make[3]: *** [Word.o] Error 1 make[2]: *** [all] Error 1 make[1]: *** [all] Error 1 make: *** [all] Error 1 Make all failed; aborting... When I change into the appropriate directory and apply the above command with a -v added on the end to find out where it's dying, it works fine. A classic case of `it doesn't crash when I'm in the debugger' (s/debugger/verbose mode/ of course). Ideas? Thanks. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-:
createPipe documentation error
I suspect this is a documentation error... Posix.createPipe returns two Fds, one for reading and one for writing. According to chapter 6 of the User Guide, they are (write,read); according to the sources and a test program, they are (read,write). Just FYI. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-:
-Wall and underscored names
Consider the following simple Haskell program. ---8--- import System data Foo = Bar | Baz deriving (Eq,Ord) main :: IO () main = do { argv - getArgs ; case argv of ["forty-two"] - print "HHGTTG" _otherwise- print "oh well" } ---8--- With this morning's ghc-4.03 and the -Wall option, I get the following: ---8--- sphere$ /homes/kw217/Scratch/Builds/i386-unknown-linux/fptools-4.xx-cvs/ ghc/driver/ghc-4.03 Test.hs -Wall Test.hs:11: Warning: Defined but not used: _otherwise Note: renameSourceCode found warnings Test.hs:3: Warning: Defined but not used: cmp_eq{-ryO-} compiler-generated-code: Warning: definition but no type signature for `con2tag_Foozh{-rxq-}' ghc-4.03: module version unchanged at 2 sphere$ ---8--- Notice three things here. 1. Despite the following comment in the CVS log for 1999/01/14 17:59:10 sof: * _ as lower-case letter, "_" is a reserved id. Prefixing unused variable names in patterns with '_' causes the renamer not to report such names as being unused. we are getting a warning for `_otherwise'. 2. The formatting of the next two warnings leaves something to be desired. 3. The warnings for cmp_eq and Foo# relate to internal GHC-generated code, rather than anything the programmer has done wrong. (except perhaps that the Eq and Ord dictionaries are not used; but then the error message is rather unclear). --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-:
Warning compiling prelude with ghc-4.03
On a GHC built with ghc-3.02 from CVS sources: cp PrelGHC.hi-boot PrelGHC.hi rm -f PrelBase.o ; if [ ! -d PrelBase ]; then mkdir PrelBase; else find PrelBase -name '*.o' -print | xargs rm -f __rm_food ; fi ; ../../../ghc/driver/ghc -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing -O -split-objs -odir PrelBase -H10m -c PrelBase.lhs -o PrelBase.o -osuf o WARNING: file rename/RnIfaces.lhs line 308 PrelPack!packCStringzh{-0j,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackCStringzh{-0u,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackNByteszh{-0r,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackAppendCStringzh{-0s,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackFoldrCStringzh{-0t,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!packCStringzh{-0j,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackCStringzh{-0u,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackNByteszh{-0r,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackAppendCStringzh{-0s,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackFoldrCStringzh{-0t,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!packCStringzh{-0j,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackCStringzh{-0u,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackNByteszh{-0r,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackAppendCStringzh{-0s,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackFoldrCStringzh{-0t,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!packCStringzh{-0j,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackCStringzh{-0u,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackNByteszh{-0r,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackAppendCStringzh{-0s,j-} WARNING: file rename/RnIfaces.lhs line 308 PrelPack!unpackFoldrCStringzh{-0t,j-} Any ideas? (it is a modified GHC, but I don't think I modified anything that early in the compiler). Thanks. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-:
-fglasgow-exts and module exports with GHC 4
I have discovered a bug in the handling of hi files in the presence of -fglasgow-exts. Below is a module, MyModule.hs, which uses Word internally but exports a function of type Integer-Integer. There is also a Main.hs module which uses this function, but of course does not import Word since it doesn't need to. Under ghc-3.02 I get the expected behaviour: I give -fglasgow-exts when compiling MyModule.hs, but not when compiling Main.hs. I do, however, need to give -fglasgow-exts when linking. Under ghc-4.01 (well, the head of the CVS tree as of yesterday), however, I need to give -fglasgow-exts when compiling Main.hs, too. This is surely wrong! I have attached a README giving a transcript of the session. --KW 8-) module MyModule ( myFun ) where import Word ( Word32 ) myFun :: Integer - Integer myFun n = let w :: Word32 w = fromInteger n w' :: Word32 w' = w + 1 in toInteger w' module Main ( main ) where import MyModule ( myFun ) main = do { let n :: Integer n = 1 ; print (myFun n) } Keith Wansbrough 1998-12-17 I think I have found a bug in GHC regarding the -fglasgow-exts flag. If I have a module that requires -fglasgow-exts, and export from this module some functions and/or constructors that don't explicitly mention this -fglasgow-exts stuff, I should be able to import the module and use it in another module without -fglasgow-exts. Certainly the compiler needs to look at the exts libraries, but this should all be behind the scenes in the hi-file-handling stuff. This appears not to be the case: First, with ghc-3.02 pl 0: sphere:FGEBug$ ghc-3.02 -c MyModule.hs MyModule.hs:3: Could not find valid interface file `Word' MyModule.hs:3: Module `Word' does not export `Word32' Compilation had errors [as I expected --KSW] sphere:FGEBug$ ghc-3.02 -c MyModule.hs -fglasgow-exts ghc-3.02: module version changed to 1; reason: no old .hi file sphere:FGEBug$ ghc-3.02 -c Main.hs ghc-3.02: module version changed to 1; reason: no old .hi file sphere:FGEBug$ ghc-3.02 Main.o MyModule.o -o main MyModule.o(.text+0x8e): undefined reference to `Word_Z36dIntegralWord320_closure' MyModule.o(.text+0x13e): undefined reference to `Word_Z36dNumWord320_closure' MyModule.o(.text+0x1de): undefined reference to `Word_Z36dNumWord320_closure' MyModule.o(.text+0x27e): undefined reference to `Word_Z36dNumWord320_closure' [annoying, but fair enough --KSW] sphere:FGEBug$ ghc-3.02 Main.o MyModule.o -o main -fglasgow-exts [now for some -v versions so you can see what's going on --KSW] sphere:FGEBug$ ghc-3.02 -v Main.o MyModule.o -o main The Glorious Glasgow Haskell Compilation System, version 3.02, patchlevel 0 Linker: gcc -v -u PrelBase_Z91Z93_closure -u PrelBase_IZh_static_info -u PrelBase_CZh_static_info -u PrelBase_False_inregs_info -u PrelBase_True_inregs_info -u DEBUG_REGS -o main Main.o MyModule.o /homes/kw217/ix86_linux/lib/ghc-3.02/TopClosure.o -L/homes/kw217/ix86_linux/lib/ghc-3.02 -lHS -lHS_cbits -lHSrts -lHSclib -lgmp -lm Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/specs gcc version 2.7.2.3 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o main -u PrelBase_Z91Z93_closure -u PrelBase_IZh_static_info -u PrelBase_CZh_static_info -u PrelBase_False_inregs_info -u PrelBase_True_inregs_info -u DEBUG_REGS /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/crtbegin.o -L/homes/kw217/ix86_linux/lib/ghc-3.02 -L/usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3 -L/usr/i386-redhat-linux/lib Main.o MyModule.o /homes/kw217/ix86_linux/lib/ghc-3.02/TopClosure.o -lHS -lHS_cbits -lHSrts -lHSclib -lgmp -lm -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/crtend.o /usr/lib/crtn.o MyModule.o(.text+0x8e): undefined reference to `Word_Z36dIntegralWord320_closure' MyModule.o(.text+0x13e): undefined reference to `Word_Z36dNumWord320_closure' MyModule.o(.text+0x1de): undefined reference to `Word_Z36dNumWord320_closure' MyModule.o(.text+0x27e): undefined reference to `Word_Z36dNumWord320_closure' Command exited with non-zero status 1 0.74user 0.53system 0:15.42elapsed 8%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (247major+668minor)pagefaults 0swaps deleting... main rm -f /tmp/ghc29648* sphere:FGEBug$ ghc-3.02 -v Main.o MyModule.o -o main -fglasgow-exts The Glorious Glasgow Haskell Compilation System, version 3.02, patchlevel 0 Linker: gcc -v -u PrelBase_Z91Z93_closure -u PrelBase_IZh_static_info -u PrelBase_CZh_static_info -u PrelBase_False_inregs_info -u PrelBase_True_inregs_info -u DEBUG_REGS -o main Main.o MyModule.o /homes/kw217/ix86_linux/lib/ghc-3.02/TopClosure.o -L/homes/kw217/ix86_linux/lib/ghc-3.02 -L/homes/kw217/ix86_linux/lib/ghc-3.02 -lHSexts -lHS -lHS_cbits -lHSrts -lHSclib -lgmp -lm Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/specs gcc version 2.7.2.3 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o main
Jeepers! message
What does this mean? (it's a warning, not an error) (compiling the prelude with a ghc-new-rts as of yesterday, plus some mods of my own, compiled with -DDEBUG using ghc-3.02, on Linux). ../../../ghc/driver/ghc -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing -O -spl it-objs -odir CPUTime-c CPUTime.lhs -o CPUTime.o -osuf o Jeepers! ReduceContext: `PrelBase.Eq{-23,n-} (PrelNum.Ratio{-3u,n-} PrelBase.Int eger{-3l,W-}) {-a2Ek-}' arising from use of `PrelNum.round{-rpc,n-}' at CPUTime. lhs:90 `PrelBase.Num{-2c,n-} (PrelNum.Ratio{-3u,n-} PrelBase.In teger{-3l,W-}) {-a2Eh-}' arising from use of `PrelNum.round{-rpc,n-}' at CPUTime .lhs:90 `PrelNum.Real{-2f,n-} (PrelNum.Ratio{-3u,n-} PrelBase.In teger{-3l,W-}) {-a2Ee-}' arising from use of `PrelNum.round{-rpc,n-}' at CPUTime .lhs:90 `PrelNum.RealFrac{-2h,n-} (PrelNum.Ratio{-3u,n-} PrelBas e.Integer{-3l,W-}) {-a2Eb-}' arising from use of `PrelNum.round{-rpc,n-}' at CPU Time.lhs:90 `PrelNum.round{-rpc,n-} at [PrelNum.Ratio{-3u,n-} PrelBa se.Integer{-3l,W-}] {-a2DI-}' arising from use of `PrelNum.round{-rpc,n-}' at CP UTime.lhs:90 Jeepers! ReduceContext: `PrelBase.Eq{-23,n-} PrelBase.Integer{-3l,W-} {-a2Em-}' arising from use of `PrelNum.round{-rpc,n-}' at CPUTime.lhs:90 `PrelBase.Eq{-23,n-} (PrelNum.Ratio{-3u,n-} PrelBase.Int eger{-3l,W-}) {-a2Ek-}' arising from use of `PrelNum.round{-rpc,n-}' at CPUTime. lhs:90 `PrelBase.Num{-2c,n-} (PrelNum.Ratio{-3u,n-} PrelBase.In teger{-3l,W-}) {-a2Eh-}' arising from use of `PrelNum.round{-rpc,n-}' at CPUTime .lhs:90 `PrelNum.Real{-2f,n-} (PrelNum.Ratio{-3u,n-} PrelBase.In teger{-3l,W-}) {-a2Ee-}' arising from use of `PrelNum.round{-rpc,n-}' at CPUTime .lhs:90 `PrelNum.RealFrac{-2h,n-} (PrelNum.Ratio{-3u,n-} PrelBas e.Integer{-3l,W-}) {-a2Eb-}' arising from use of `PrelNum.round{-rpc,n-}' at CPU Time.lhs:90 `PrelNum.round{-rpc,n-} at [PrelNum.Ratio{-3u,n-} PrelBa se.Integer{-3l,W-}] {-a2DI-}' arising from use of `PrelNum.round{-rpc,n-}' at CP UTime.lhs:90 Jeepers! ReduceContext: `PrelBase.Show{-2i,n-} (PrelNum.Ratio{-3u,n-} PrelBase.I nteger{-3l,W-}) {-a2En-}' arising from use of `PrelNum.round{-rpc,n-}' at CPUTim e.lhs:90 `PrelBase.Num{-2c,n-} (PrelNum.Ratio{-3u,n-} PrelBase.In teger{-3l,W-}) {-a2Eh-}' arising from use of `PrelNum.round{-rpc,n-}' at CPUTime .lhs:90 `PrelNum.Real{-2f,n-} (PrelNum.Ratio{-3u,n-} PrelBase.In teger{-3l,W-}) {-a2Ee-}' arising from use of `PrelNum.round{-rpc,n-}' at CPUTime .lhs:90 `PrelNum.RealFrac{-2h,n-} (PrelNum.Ratio{-3u,n-} PrelBas e.Integer{-3l,W-}) {-a2Eb-}' arising from use of `PrelNum.round{-rpc,n-}' at CPU Time.lhs:90 `PrelNum.round{-rpc,n-} at [PrelNum.Ratio{-3u,n-} PrelBa se.Integer{-3l,W-}] {-a2DI-}' arising from use of `PrelNum.round{-rpc,n-}' at CP UTime.lhs:90 ghc: 249662800 bytes, 148 GCs, 1525102/1571752 avg/max bytes residency (2 samp les), 0.03 INIT (0.01 elapsed), 9.41 MUT (10.57 elapsed), 1.00 GC (1.07 elapsed) :ghc ghc: module version changed to 1; reason: no old .hi file Thanks.. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-:
Re: ghc-4.00 cvs source build question
This morning I got the cvs source tree from CVSROOT="[EMAIL PROTECTED]:/cvs" [..] Did you put Version 3.03 back in the repository? Or is it just the wrong name? [to the list because I had the same problem] The head of the tree is still 3.03; if you want 4 you have to do cvs co -r new-rts fpconfig cd fptools cvs co -r new-rts ghc HTH. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) : : PhD Student, Computer Laboratory, University of Cambridge, England. : : (and recently of the University of Glasgow, Scotland. [] ) : : Native of Antipodean Auckland, New Zealand: 174d47' E, 36d55' S.: : http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] : :-: