VB: Bug, perhaps to do with functional dependencies?

Simon Peyton-Jones simonpj at microsoft.com
Fri Jan 26 10:10:38 EST 2001


OK, the problem here is that GHC 4.08 doesn't support functional
dependencies.  I've just finished making GHC support them, but
it won't be in 4.08 (ever).  It'll be in GHCi 5.0.

Sorry about that!

(4.08.2 will complain about fundeps rather than just going wrong.)

Simon

| -----Original Message-----
| From: michael.weber at post.rwth-aachen.de
| [mailto:michael.weber at post.rwth-aachen.de]
| Sent: 22 January 2001 20:05
| To: glasgow-haskell-bugs at haskell.org
| Subject: Re: VB: Bug, perhaps to do with functional dependencies?
| 
| 
| * John Hughes <john.hughes at swipnet.se> [2001-01-22T20:10+0100]:
| >    liam at HEMPC ~/BDDs
| >    $ ghc -static -c -fglasgow-exts Pigeon.hs
| [...]
| >    basicTypes/Var.lhs:194: Non-exhaustive patterns in function
| >    readMutTyVar
| 
| This is a nice one.  If you change it in a sublte way:
| 
| +++ Pigeon.hi
|  pigeon n t = 
| -  do a<-at 1
| +  do a<-at
|       orBDD t a a
| -  where at i = varBDD t 0
| +  where at = varBDD t 0
| 
| it compiles, but GHC emits:
| 
| zonkIdOcc:  FunDep_aMr
| zonkIdOcc:  FunDep_aMr
| 
| 
| This leads to Imperative.hi, in which you are using Functional
| Dependencies, obviously.  While I don't know jack about them, I
| remember them causing some glitches in GHC (which might already be
| solved in CVS).  However, I edited the FD away in Imperative.hi and
| Pigeon.hs compiled (even your original version).
| 
| +++ Imperative.hi
| -1 class {PrelBase.Monad m}  => Imperative s m :: (* -> *) | 
| m -> s where {st :: __forall [a] => PrelST.ST s a -> m a} ;
| +1 class {PrelBase.Monad m}  => Imperative s m :: (* -> *) 
| where {st :: __forall [a] => PrelST.ST s a -> m a} ;
| 
| >    There is no file Var.lhs on my machine: I assume it's part of the
| >    source of GHC.
| 
| yes. <fptools>/ghc/compiler/basicTypes/Var.lhs
| 
| >    What's the behaviour that is wrong, in my opinion? Well, 
| firstly (and
| >    mainly) that the compiler rejects the program at all. 
| Secondly that
| >    the error message refers to a non-existent source file. 
| And thirdly,
| >    since when have non-exhaustive patterns been an error? 
| That's about
| >    it!
| 
| internal compiler error =)  Maybe someone should mark them in a more
| obvious way...
| 
| >    Grateful for help -- it would be fun to see how much 
| speedup I get
| >    from GHC...!
| 
| Want to beat SMV/BMC?  =)
| 
| 
| Cheers,
| M/
| -- 
| () ASCII ribbon campaign |  Chair for Computer Science  II  | 
| GPG: F65C68CD
| /\ against HTML mail     |       RWTH Aachen, Germany       | 
| PGP: 1D0DD0B9
| 
|        WWW: http://www-i2.informatik.rwth-aachen.de/Software/Haskell/
| 
| _______________________________________________
| Glasgow-haskell-bugs mailing list
| Glasgow-haskell-bugs at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
| 




More information about the Glasgow-haskell-bugs mailing list