This is all very embarassing.   It's definitely a compiler bug.
It was introduced when a perfectly reasonable change by Jeff
Lewis finally stretched the wobbly kind-inference setup beyond
what it could manage.  I've now fixed kind inference in a thorough-going
way.

But all of this was meant to take place on the head, not on the 4.08
branch.  Alas, Jeff's change leaked into 4.08. 

This is something we have to fix.  4.08 patch-level 1 here we come!

Meanwhile, Martin, use an earlier version of GHC!  Or a later version
(i.e. build the head of the CVS tree).   I'm sorry this bit you.   Needless
to say, there is now a test in the repository that will show it up next
time.

Simon

| -----Original Message-----
| From: Martin Pokorny [mailto:[EMAIL PROTECTED]]
| Sent: 18 July 2000 04:13
| To: Simon Peyton-Jones
| Cc: Michael Weber; [EMAIL PROTECTED]
| Subject: Re: What is `AClass'?
| 
| 
| Well, I pared and whittled and cut away until I was left with
| remarkably little code! In the code below, when I replace the `Matrix'
| context in the `amap2' function with `IArray', the file compiles
| without a warning. Perhaps I'm still too much the novice to see an
| error on my part, but the code seems to be valid Haskell to me. I also
| have ghc 4.08 installed on my Windows NT machine at work, and the
| results were the same as on my Debian Gnu/Linux machine. This is my
| code:
| 
| > module Matrix
| > where
| > 
| > import IArray
| > import Ix
| > 
| > class (IArray a e) => Matrix a e where
| > 
| >   amap2  :: (Ix ix, Matrix a d) =>
| >             (e -> d -> e) -> a ix e -> a ix d -> a ix e
| 
| 
| And this is the output of a compiler run:
| 
| > ~/projects/hs/mtx.2$ ghc -Wall -v -fglasgow-exts -c MatrixB.hs
| > The Glorious Glasgow Haskell Compilation System, version 4.08
| > 
| > Effective command line: -Wall -v -fglasgow-exts -c
| > 
| > Ineffective C pre-processor:
| >     echo '{-# LINE 1 "MatrixB.hs" -}' > /tmp/ghc743.cpp && 
| cat MatrixB.hs >> /tmp/ghc743.cpp
| > 
| > real        0m0.001s
| > user        0m0.010s
| > sys 0m0.000s
| > ghc:compile:Output file MatrixB.o doesn't exist
| > ghc:compile:Interface file MatrixB.hi doesn't exist
| > ghc:recompile:Input file MatrixB.hs newer than MatrixB.o
| > 
| > Haskell compiler:
| >     /usr/lib/ghc-4.08/hsc /tmp/ghc743.cpp  
| -fwarn-overlapping-patterns -fwarn-missing-methods 
| -fwarn-missing-fields -fwarn-deprecations 
| -fwarn-duplicate-exports -fwarn-unused-binds 
| -fwarn-unused-matches -fwarn-incomplete-patterns 
| -fwarn-unused-imports -fwarn-type-defaults 
| -fwarn-name-shadowing -fwarn-missing-signatures 
| -fglasgow-exts -fignore-interface-pragmas 
| -fomit-interface-pragmas -fsimplify [ 
| -fmax-simplifier-iterations4 ]   -fwarn-overlapping-patterns 
| -fwarn-missing-methods -fwarn-missing-fields 
| -fwarn-deprecations -fwarn-duplicate-exports -fhi-version=408 
| -static 
| "-himap=.%.hi:/usr/lib/ghc-4.08/imports/lang%.hi:/usr/lib/ghc-
| 4.08/imports/lang%.hi:/usr/lib/ghc-4.08/imports/std%.hi" 
| "-himap-sep=:"    -v -hifile=/tmp/ghc743.hi -olang=asm 
| -ofile=/tmp/ghc743.s -F=/tmp/ghc743_stb.c 
| -FH=/tmp/ghc743_stb.h +RTS -H6000000 -K1000000
| > Glasgow Haskell Compiler, version 4.08, for Haskell 98, 
| compiled by GHC version 4.08
| > 
| > AClass
| > 
| > real        0m7.321s
| > user        0m3.840s
| > sys 0m0.160s
| > deleting... /tmp/ghc743.cpp /tmp/ghc743.hi /tmp/ghc743.s 
| /tmp/ghc743_stb.c /tmp/ghc743_stb.h
| 
| I hope this helps.
| -- 
| Martin Pokorny
| mailto:[EMAIL PROTECTED]
| 

Reply via email to