Misha,

This feels like you would compose dictionary types in heterogeneous lists and 
then have a type-driven lookup from the dictionary list; this would be very 
similar to the lookup operation for TICs in the HList lib, only that the 
driving type is of kind *->* and that the traversing instances eventually need 
to be constrained by the Sat constraint for the driving type. Do you think, 
this could work?

Best,
Ralf

> > f :: (Contains cxt ShowCxt) => Box cxt -> String
> > f (Box a) = show a
>
>   The type is meant to say that the context of the box must contain
> Show
> as one of the classes. I would imagine the Contains class to be
> something like
>
> > class Contains cxt subCxt where
> >   subDict :: cxt a -> subCxt a

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

Reply via email to