GHC 2.04 List module: minor 1.4 conformance pbs and a bug (?)
[Sorry if this comes twice, Mew died on me.] Hi In GHC 2.04, the module List does not conform to the Haskell 1.4 Library Report (but it should?): List needs to export the definitions `unionBy' and `intersectBy'. Also, unless I haven misunderstood something, the definition of `unionBy', and thus `union', is wrong (although identical to the one in the report): Bug.hs import List {- from List.lhs union :: (Eq a) => [a] -> [a] -> [a] union = unionBy (==) unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] unionBy eq xs ys= xs ++ foldl (flip (deleteBy eq)) ys xs -} main = print (union [] [1,1]) The answer is [1,1], but should be [1] (see *). `unionBy' needs to "nub" the argument `ys' and use the result in the fold. Cheers, Bjarte *) Haskell 1.4 Library Report, page 26, paragraph 5: [...] union and intersect preserve the invariant that lists don't contain duplicates, provided that their first argument contains no duplicates. -- Bjarte M. ?stvold [EMAIL PROTECTED] Dept. of Computer and Information Science +47 73 59 44 83 (ph) Norwegian Univ. of Science and Technology +47 73 59 44 66 (fax) Gl?shaugen, N-7034 Trondheim, Norway
2.02 newtype problem
In ghc 2.02 I seem to be having a problem. The following program module Test where newtype Test = Test String deriving (Eq, Ord) test :: [Test] -> Test test = maximum gives the error Test.hs:6: No instance for: PrelBase.Ord Test.Test Test.hs:6: at a use of an overloaded identifier: `PrelList.maximum' Changing newtype to data compiles fine however. Justin
Re: -monly-N-regs ?
Ian Collier wrote: > > While I was trying to compiling ArrBase.o on i386-unknown-solaris2 this > message appeared: > > >/tmp/ghc18527.hc:6388: fixed or forbidden register was spilled. > >This may be due to a compiler bug or to impossible asm > >statements or clauses. > This happened with me, with ghc-2.04 aswell. Sigbjorn said "the backend is trying to steal more x86 registers than gcc can handle". The solution is to do the following, compile ArrBase separately using: make EXTRA_HC_OPTS=-monly-2-regs ghc/ArrBase.o Then go on with the make. -- Meurig Sage Dept of Computing Science University of Glasgow http://www.dcs.gla.ac.uk/~meurig mailto:[EMAIL PROTECTED]
-monly-N-regs ?
While I was trying to compiling ArrBase.o on i386-unknown-solaris2 this message appeared: >/tmp/ghc18527.hc:6388: fixed or forbidden register was spilled. >This may be due to a compiler bug or to impossible asm >statements or clauses. Looking up gcc in the docs gave me this: >If your GCC dies with ``internal error'' on some GHC source file, >please let us know, so we can report it and get things improved. >(Exception: on \tr{iX86} boxes---you may need to fiddle with GHC's >\tr{-monly-N-regs} option; ask if confused...) What does it all mean? imc PS gcc version is 2.7.2.1
Re: More questions on installing 2.05
Me again... :-( After my success at compiling ghc-2.05 on SunOS 4, I am now attempting it on sparc-sun-solaris2.5.1 and i386-unknown-solaris2.5 and both of them have stopped with this: ghc-0.29 -cpp -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC -Rghc-timing -I. -I codeGen -InativeGen -Iparser -iutils -ibasicTypes -itypes -ihsSyn -iprelude -i rename -itypecheck -ideSugar -icoreSyn -ispecialise -isimplCore -istranal -ist gSyn -isimplStg -icodeGen -iabsCSyn -imain -ireader -iprofiling -iparser -inat iveGen -fomit-derived-read -fomit-reexported-instances -DOMIT_DEFORESTER -O -H 20m-c absCSyn/PprAbsC.lhs -o absCSyn/PprAbsC.o -osuf o "codeGen/ClosureInfo.hi", line 72: undefined type constructor: StgSyn.StgBinderInfo "codeGen/ClosureInfo.hi", line 74: undefined type constructor: CgMonad.CgInfoDownwards "codeGen/ClosureInfo.hi", line 74: undefined type constructor: CgMonad.CgState [snip more of the same] Compilation had errors make: *** [absCSyn/PprAbsC.o] Error 1 (and is there any way to get "make all" abort if "cd ghc/compiler;make all" has errors?) Oddly enough it compiles OK if I take the -O out, so perhaps I'll continue with that (it occurs to me that I probably didn't compile the sunos one with the -O flag. [pause] yes, it doesn't work with -O on sunos either). imc
Re: More questions on installing 2.05
On Tue, 05 Aug 1997 00:50:05 +0100 (BST), Sigbjorn Finne said: > > Question 3: How do I even make the docs? > You'll have to give the doc target, e.g., 'make dvi', in the > directory containing the .lit files. OK, I've got somewhere with this (is it mentioned anywhere in the installation instructions?) but in the users_guide directory the command lit2latex -c -o runtime_control.itex runtime_control.lit makes a file runtime_control.itex which is full of control characters and weird things. For example, the very first line of it is lit^@ile!_!-!_!1!_! and it contains no fewer than 30 copies of a single paragraph with minor variations. What gives? imc