
29 Dec
2007
29 Dec
'07
10:43 p.m.
On Dec 28, 2007, at 10:18 PM, ajb@spamcop.net wrote:
Quoting alex
: I would like to do this:
class Foo t where hi :: t -> Bool
class Foo t => Bar t where hi x = True
This is arguably one of the most requested features in Haskell. The only reason why it hasn't been implemented yet is that some of the corner cases are a little subtle.
Really? This code doesn't even really make any sense to me. In order to be an instance of Bar, t has to already be an instance of Foo, implying that the function hi is already defined for t. What would the function in this example do? instance Foo Wibble where hi x = False instance Bar Wibble myFunc :: Wibble -> Bool myFunc x = hi x