On Dec 28, 2007, at 10:18 PM, [EMAIL PROTECTED] wrote:

Quoting alex <[EMAIL PROTECTED]>:

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

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to