On 24 Nov 2004, at 19:16, Scott Turner wrote:

Each error type is an instance of Hierarchical, so that its errors may be
considered part of a larger category of errors. In the instance definition,
'parent' specifies how the error appears if it is caught by a handler
expecting then next more general error type.



Dynamic seems to be a sledgehammer for this particular nut.

Can we not have a type class for 'subtyping' (like your hierarchical). Can multi-parameter typeclasses do this? We want:

class SubType a b where
        inject :: a -> b

and

instance SubType a b,SubType b c => SubType a c where
        inject :: a -> c
        inject some_a = inject ((inject some_a) :: b)

and then the definition of `except` requires that the SubType relates the type of the handler and the type of the actual error?

Jules

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to