type error when compiling an older Haskell program

Stefan O'Rear stefanor at cox.net
Sat Jul 7 23:17:51 EDT 2007

On Sat, Jul 07, 2007 at 10:53:17PM -0400, Scott Stoller wrote:
> hi,
> thanks to Stefan, I am past the second problem in compiling this program
> (needed to change 'bounds' to 'getBounds').  now I get a more intimidating
> error message...
> I am trying to compile paradox 1.0, an older (GHC 5) Haskell program, with
> GHC 6.6.1.  I get the intimidating error message shown below.  I would
> appreciate any advice about how to fix this.  I am guessing that the
> problem might be a change in the type of some library function.
> best regards,
> scott
> p.s. the file causing the error is in the paradox source code at
> http://www.cs.sunysb.edu/~stoller/out/paradox-1.0-casc.tar.gz

Add {-# OPTIONS_GHC -fno-mono-pat-binds #-}

You are the fourth person to discover monomorphic pattern bindings :)

As an experiment, the GHC team has changed GHC to make pattern bindings
(like MkT m = tm) default to only produce values usable at one type.
The full generality of Haskell-98's rules complicated the
implementation, and the idea was that if sufficiently few people
complained, the next version of Haskell could use simpler rules.  (at
least that's how *I* remember the explanation.)

Another workaround is to do it with an explicit unwrap:

 where m = case tm of MkT m -> m

instead of

 where MkT m = tm


More information about the Glasgow-haskell-users mailing list