bug with rank n polymorphism in classes
Simon Peyton-Jones
simonpj at microsoft.com
Wed Aug 28 07:20:32 EDT 2002
Please say which version of GHC you are using.
This program works fine with GHC 5.02.2
Simon
| -----Original Message-----
| From: Hal Daume III [mailto:hdaume at ISI.EDU]
| Sent: 22 August 2002 20:47
| To: glasgow-haskell-bugs at haskell.org
| Subject: bug with rank n polymorphism in classes
|
|
| consider:
|
| module Foo where
|
| class Foo p where
| foo :: p -> (forall q . Foo q => q -> a) -> a
|
| instance Foo Int where
|
|
| if you load this in to ghci, it complains:
|
| /home/hdaume/projects/NLP/Foo.hs:6:
| Ambiguous type variable(s) `q' in the constraint `Foo q'
| arising from a function with an overloaded argument type
| at /home/hdaume/projects/NLP/Foo.hs:6
| Expected type: Int -> (forall q1. (Foo q1) => q1 -> a) -> a
| Inferred type: Int -> (q -> a) -> a
| In the application `GHC.Err.noMethodBindingError
| "/home/hdaume/projects/NLP/Foo.hs:6|Foo.foo"#'
|
| which is a reasonable complaint, but is emiited in a rather
| bizzare way.
|
| --
| Hal Daume III
|
| "Computer science is no more about computers | hdaume at isi.edu
| than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
|
| _______________________________________________
| 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