
On Tue, 1 Jun 2010 21:10:40 +0200, Bas van Dijk
fallback :: Resource cap IO -> Resource cap IO -> Resource cap IO fallback (Resource primary) (Resource backup) = Resource l where l c = primary c `catch` (\ ProblemWithMainResource -> backup c)
; the fact that @c@, the "continuation" (which describes how the capability is used), is mentioned twice in the body of @l@ makes this a weird case. By the way, Bas, I'm not quite sure how to properly use your Resource class. Should one create different datatypes for different resources, if they have different handle types or open/close functions, even though they provide the same "capability"? I would like to avoid this, if possible, to make life easier for users of these resources (they just want a resource providing a certain capability, and don't care about its internal state). I suppose one can create a class of resources giving a certain capability instead. Kind regards, Arie