constraints inside classes
Simon Peyton-Jones
simonpj at microsoft.com
Fri Mar 8 07:40:41 EST 2002
OK, OK. I give in!
I've lifted this restriction in the HEAD.
Simon
| -----Original Message-----
| From: Marcin 'Qrczak' Kowalczyk [mailto:qrczak at knm.org.pl]
| Sent: 24 February 2002 08:02
| To: glasgow-haskell-bugs at haskell.org
| Subject: Re: constraints inside classes
|
|
| Fri, 22 Feb 2002 12:55:13 -0800, Mark P Jones <mpj at cse.ogi.edu> pisze:
|
| > | class Foo a where
| > | f :: Eq a => a -> Bool
| >
| > This behavior of Hugs is intentional, and is documented as
| a non-bug
| > on the Hugs web pages: (right at the end)
| >
| > http://cvs.haskell.org/Hugs/pages/bugsandfeatures.htm
| >
| > I don't know how the "non bug" status was determined, but
| perhaps it
| > reflects a view that the real bug is in the language
| report, where a
| > demonstrably unnecessary, and potentially limiting restriction is
| > imposed.
|
| It's indeed limiting and IMHO should be removed; I have told
| about it some time ago. Here is a stripped-down example where
| it's necessary:
|
| class Seq s a where
| fromList :: [a] -> s a
| elem :: Eq a => a -> s a -> Bool
|
| I've seen attempts at expressing such class with features
| that GHC allows but they were all wrong.
|
| --
| __("< Marcin Kowalczyk * qrczak at knm.org.pl
| http://qrczak.ids.net.pl/ \__/
| ^^
| QRCZAK
|
|
| _______________________________________________
| 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