Possible bug in ghc 4.08.1, I leave it to you
Sigbjorn Finne
sigbjorn_finne at hotmail.com
Thu Feb 1 13:14:27 EST 2001
Martin Norbäck d95mback at dtek.chalmers.se writes:
>
> Hi!
>
> > a :: Show c => c -> Integer
> > a err = if b > 0 then error (show err) else 1
>
> > b :: Integer
> > b = a "dummy"
>
> This program (although it doesn't do much good), type checks perfectly
> in hugs. (I have a larger version which actually does some good as
> well).
>
> But in ghc 4.08.1 I get the following error.
>
> Mismatched contexts
> When matching the contexts of the signatures for `b' and `a'
> (the signature contexts in a mutually recursive group should all be
identical)
> But where is this requirement in the Haskell report? It might be that I
> don't understand what the report says, but this seems like a perfectly
> good use to me.
See 4.5.2 of the report and section 11.6.3 of Mark Jones' "Typing Haskell
in Haskell" (http://www.cse.ogi.edu/~mpj/thih/ ) paper for a discussion of
the issue. The conclusion there is that the H98 restriction on the shape of
signature contexts in mut-rec groups is overly restrictive. Last I heard
(about 12 months ago) was that Simon PJ _might_ consider treating this
as a bug in the H98 report & change it.
hth
--sigbjorn
More information about the Glasgow-haskell-bugs
mailing list