> If you write the instance
>         instance Theta => Foo (T a b) where ...
> where Theta is an arbitrary context, then, given a dictionary for (Foo (T a 
> b)), you can get dictionaries for each constraint in Theta.  Or in logic
>
>        Theta <=> Foo (T a b)
>
> In your example, Theta is empty.

>If you'd written
>        instance (Show a, Ix b) => Ord (a,b) then you could get a Show a and 
> Ix b dictionaries from an Ord (a,b) dictionary.  (But not an Ord a or Ord b > 
> one.)

I sort of see, but then what is Tom actually proposing? Replacing the body of 
the Ord declaration with something like OrdDict, thus forcing any possible 
instance for Ord (a, b) to provide OrdDict a and OrdDict b because of the 
definition of Super?

In the current world, the possibility of instances like (Foo, Foo) make it 
impossible to write the code I originally asked about, so something would have 
to change, either with Ord or with my code, to be able to do anything like it.

Ganesh


==============================================================================
Please access the attached hyperlink for an important electronic communications 
disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to