31 Jul 2000 12:33:31 -0700, Carl R. Witty <[EMAIL PROTECTED]> pisze:

> One simple constraint which proves termination is that every proper
> subterm of an "antecedent" must also be a proper subterm of the
> "conclusion".  An instance declaration like
> 
>     (P (F [a]) (G [(a, b)]) (H a [b]), Q b a) => (R (H (F [a]) [(G [(a, b)])]) (H a 
>[b]) c)
> 
> would thus be acceptable.

Ah! I just needed
   instance ForeignRes (Ptr a) b => ForeignRes (ThrowNull (Ptr a)) b
but for GHC it's undecidable. I had to use
   instance ForeignRes (ThrowNull (Ptr a)) (Ptr a)
which is theoretically less general, although in practice it suffices.

It's annoying that an analogous variant works:
   instance (Num a, ForeignRes a b) => ForeignRes (Throw_1 a) b
only because the type is not concrete.

As I understand it, this rule would allow it. Please, can GHC be
changed to support that?

-- 
 __("<  Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK


Reply via email to