Possible bug in ghc 4.08.1, I leave it to you
Martin Norbäck
d95mback at dtek.chalmers.se
Thu Feb 1 05:21:46 EST 2001
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.
If i remove the type declarations I get errors about c not being general
enough in my code, and in this small example it is mysteriously
instantiated to String!
If you could help me with this problem it would be much appreciated!
Martin
--
[ http://www.dtek.chalmers.se/~d95mback/ ] [ PGP: 0x453504F1 ] [ UIN: 4439498 ]
Opinions expressed above are mine, and not those of my future employees.
<!-- If your reader parses HTML you won't see this, you stupid, ugly person -->
SIGBORE: Signature boring error, core dumped
More information about the Glasgow-haskell-bugs
mailing list