Non-variable instance contexts.
I hate this error. Whilst arguably this is an "untested" extension to Standard Haskell, it seemed pretty sound in practice. Can't we at least have it back as a GlaExt? (MSExt?) I'm starting to feel more than a little Quaint having to use ghc-3.01, just to get my programs to compile... (If anyone has a good systematic workaround to suggest, I'm all ears.) ghc-4.00 -c Intervals.hs -H30m -K2M -recomp -fglasgow-exts -cpp -syslib misc -Rgc-stats -dshow-passes -fmax-simplifier-iterations4 -funfolding-use-threshold-0 -fvia-C Intervals.hs:460: Illegal constaint `Ord (s e)' in instance context (Instance contexts must constrain only type variables) [etc, etc] Slainte, Alex.
bug report 4.00
Hi there, While compiling some stuff with 4.00 I get the following output before compilation stops. [snip] GNU CPP version 2.7.2 (sparc) #include "..." search starts here: #include ... search starts here: . /usr/local/ghc-4.00/lib/ghc-4.00/includes /usr/local/ghc-4.00/lib/ghc-4.00/includes /usr/local/include /usr/local/sparc-sun-solaris2.5/include /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include /usr/include End of search list. /usr/local/ghc-4.00/lib/ghc-4.00/includes/ClosureMacros.h:140: unterminated character constant /usr/local/ghc-4.00/lib/ghc-4.00/includes/StgMacros.h:87: unterminated string or character constant real0.3 user0.2 sys 0.0 deleting... /tmp/ghc6070.cpp /tmp/ghc6070.hi /tmp/ghc6070.hc /tmp/ghc6070_stb.c /tmp/ghc6070_stb.h ghc6070.c ghc6070.s /tmp/ghc6070_o.s rm -f /tmp/ghc6070* make: *** [Result.o] Error 1 Needless to say I haven't changed ClosereMacros.h or StgMacros.h Any suggestions how to fix this? Regards, Marc
RE: bug report 4.00
While compiling some stuff with 4.00 I get the following output before compilation stops. [snip] GNU CPP version 2.7.2 (sparc) #include "..." search starts here: #include ... search starts here: . /usr/local/ghc-4.00/lib/ghc-4.00/includes /usr/local/ghc-4.00/lib/ghc-4.00/includes /usr/local/include /usr/local/sparc-sun-solaris2.5/include /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include /usr/include End of search list. /usr/local/ghc-4.00/lib/ghc-4.00/includes/ClosureMacros.h:140: unterminated character constant /usr/local/ghc-4.00/lib/ghc-4.00/includes/StgMacros.h:87: unterminated string or character constant real0.3 user0.2 sys 0.0 deleting... /tmp/ghc6070.cpp /tmp/ghc6070.hi /tmp/ghc6070.hc /tmp/ghc6070_stb.c /tmp/ghc6070_stb.h ghc6070.c ghc6070.s /tmp/ghc6070_o.s rm -f /tmp/ghc6070* make: *** [Result.o] Error 1 Are you passing any extra flags to GHC? Could you send a copy of the file and a full transcript of the compilation with '-v' please. Cheers, Simon -- Simon Marlow Microsoft Research Ltd., Cambridge, U.K.
reply to `I hate this error'
Alex Fergusson writes I hate this error ... ghc-4.00 -c Intervals.hs -H30m -K2M -recomp -fglasgow-exts -cpp -syslib misc -Rgc-stats -dshow-passes -fmax-simplifier-iterations4 -funfolding-use-threshold-0 -fvia-C Intervals.hs:460: Illegal constaint `Ord (s e)' in instance context (Instance contexts must constrain only type variables) Is not this due to omitting -optC-fallow-undecidable-instances -optC-fallow-overlapping-instances ? Sorry, if i am missing the point. -- Sergey Mechveliani [EMAIL PROTECTED]
RE: reply to `I hate this error'
Intervals.hs:460: Illegal constaint `Ord (s e)' in instance context (Instance contexts must constrain only type variables) Is not this due to omitting -optC-fallow-undecidable-instances -optC-fallow-overlapping-instances That's right. It's the undecidable instances one in fact. Sorry about the -optC; we need to update the driver to recognise it Simon
Re: reply to `I hate this error'
Sergey writes: Is not this due to omitting -optC-fallow-undecidable-instances -optC-fallow-overlapping-instances ? Sorry, if i am missing the point. No, I was! ;-) And thanks to Simon(s) for pointing this out, too. Mind you, I somewhat object to the "undecidable" bit: I thought the current thinking was that "simple" non-variable contexts were a sound, decidable extension? [ The proof's in the post. ;-) ] Slan, Alex.
RE: 4.00, s-s-s, linker errors.
? S, A. cvs up C, S
4.00, s-s-s bug.
Here's a very cut down version of the bug-exhibiting program mentioned earlier. Sorry, if I cut it down any more, it compiles! Slan, Alex. _ swift.ucc.ie:~/filt4: ghc M.lhs MachRegs.lhs:563: Non-exhaustive patterns in function baseRegOffset swift.ucc.ie:~/filt4: cat M.lhs module M where data T = C Int f a b c d e f g h = s a b s x (C _ ) = ()
RE: 4.00, s-s-s, linker errors.
? S, A. cvs up C, S Or you may have picked up a dodgy binary dist. In which case, the one at ftp://ftp.dcs.gla.ac.uk/pub/haskell/glasgow/4.00/ghc-4.00-sparc-sun-solaris2 .tar.gz should be ok. Cheers -- Simon Marlow Microsoft Research Ltd., Cambridge, U.K.
RE: 4.00, s-s-s, linker errors.
Or you may have picked up a dodgy binary dist. That was the one... One last (?) problem... This program: module Main where import IOExts main = trace "Boogger" print 1 ain't playin', as follows (maxi-spam version). Slainte, Alex. _ oconnor.ucc.ie:~/filt4: ghc -v -syslib misc Trc.hs The Glorious Glasgow Haskell Compilation System, version 4.00, patchlevel 0 Effective command line: -v -syslib misc Ineffective C pre-processor: echo '{-# LINE 1 "Trc.hs" -}' /tmp/ghc25004.cpp cat Trc.hs /tmp/ghc25004.cpp real0.0 user0.0 sys 0.0 ghc:compile:Interface file Trc.hi doesn't exist Haskell compiler: /usr/local/ghc-4.00/lib/ghc-4.00/hsc ,-W ,/tmp/ghc25004.cpp -fignore-interface-pragmas -fomit-interface-pragmas -fsimplify [ -ffloat-lets-exposing-whnf -ffloat-primops-ok -fcase-of-case -fdo-case-elim -freuse-con -fpedantic-bottoms -fclone-binds -fmax-simplifier-iterations4 ] -fwarn-overlapping-patterns -fwarn-missing-methods -fwarn-duplicate-exports -fhi-version=400 -himap=.%.hi:/usr/local/ghc-4.00/lib/ghc-4.00/imports/exts%.hi:/usr/local/ghc-4. 00/lib/ghc-4.00/imports/misc%.hi:/usr/local/ghc-4.00/lib/ghc-4.00/imports/exts%. hi:/usr/local/ghc-4.00/lib/ghc-4.00/imports/misc%.hi:/usr/local/ghc-4.00/lib/ghc -4.00/imports/std%.hi -v -hifile=/tmp/ghc25004.hi -S=/tmp/ghc25004.s -F= -FH= +RTS -H600 -K100 Glasgow Haskell Compiler, version 4.00, for Haskell 1.4 real1.8 user1.6 sys 0.0 Pin on Haskell consistency info: echo ' .text hsc.Trc.hs.40.0..:' /tmp/ghc25004.s real0.0 user0.0 sys 0.0 *** New hi file follows... _interface_ Main 400 _instance_modules_ IO PrelAddr PrelArr PrelBounded PrelCCall PrelForeign PrelIOBase PrelNum PrelNumExtra PrelTup _usages_ IO 1 :: print 1; IOExts 1 :: trace 1; PrelBase 1 :: $dEq0 1 $dEq1 1 $dEqBool0 1 $dEqChar0 1 $dEqInt0 1 $dEqInteger0 1 $dNumInt0 1 $dShow0 1 $dShow1 1 $dShow2 1 $dShowBool0 1 $dShowChar0 1 $dShowInt0 1 $m- 1 $m/= 1 $mfromInt 1 $mshowList 1 addr2Integer 1 foldr 1 int2Integer 1 integer_0 1 integer_1 1 integer_2 1 integer_m1 1 Eq 1 Num 1 Show 1 String 1; PrelIOBase 1 :: IO 1; PrelNum 1 :: $dNumInteger0 1 $dShowInteger0 1; PrelNumExtra 1 :: $dEqDouble0 1 $dNumDouble0 1 $dShowDouble0 1; PrelPack 1 :: packCString# 1 unpackAppendCString# 1 unpackCString# 1 unpackFoldrCString# 1 unpackNBytes# 1; _exports_ Main main; _declarations_ main _:_ PrelIOBase.IO PrelBase.() ;; ghc: module version unchanged at 2 Replace .hi file, if changed: cmp -s Main.hi /tmp/ghc25004.hi-new || ( rm -f Main.hi cp /tmp/ghc25004.hi-new Main.hi ) real0.0 user0.0 sys 0.0 Unix assembler: gcc -o Trc.o -c -I. -I/usr/local/ghc-4.00/lib/ghc-4.00/includes -I/usr/local/ghc-4.00/lib/ghc-4.00/includes /tmp/ghc25004.s real0.1 user0.0 sys 0.0 Linker: gcc -v -u PrelBase_IZh_static_info -u PrelBase_CZh_static_info -u PrelBase_False_static_closure -u PrelBase_True_static_closure -u PrelMain_mainIO_closure Trc.o -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -lHSmisc -lHSmisc_cbits -lnsl -lsocket -lHSexts -lHSmisc -lHSmisc_cbits -lnsl -lsocket -lHSexts -lHS -lHS_cbits -lHSrts -lgmp -lm Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.3/specs gcc version 2.7.2.3 /usr/ccs/bin/ld -V -Y P,/usr/ccs/lib:/usr/lib -Qy -u PrelBase_IZh_static_info -u PrelBase_CZh_static_info -u PrelBase_False_static_closure -u PrelBase_True_static_closure -u PrelMain_mainIO_closure /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.3/crt1.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.3/crti.o /usr/ccs/lib/values-Xa.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.3/crtbegin.o -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/ghc-4.00/lib/ghc-4.00 -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.3 -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/local/lib Trc.o -lHSmisc -lHSmisc_cbits -lnsl -lsocket -lHSexts -lHSmisc -lHSmisc_cbits -lnsl -lsocket -lHSexts -lHS -lHS_cbits -lHSrts -lgmp -lm -lgcc -lc -lgcc /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.3/crtend.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.3/crtn.o ld: Software Generation Utilities (SGU) SunOS/ELF (LK-2.0 (S/I) - versioning) Undefined first referenced symbol in file IOExts_trace_closureTrc.o ld: fatal: Symbol referencing errors. No output written to a.out real0.6 user0.4 sys 0.1 deleting... a.out rm -f /tmp/ghc25004*