The Finally module is useful independently of the fiber management model provided by Picos_structured.
This also introduces a number of changes:
The 'resource finally type is renamed to 'resource template.
The 'resource moveable type is renamed to 'resource instance.
The semantics of let^ is changed such that it also releases the resource in case an exception has been raised in the scope.
A borrow mechanism is added, as the let& binding operator, to allow one to use a resource acquired as a 'resource instance before moving the resource to another scope.
A way to explicitly release the resource held by an instance movable is also added.
The
Finally
module is useful independently of the fiber management model provided byPicos_structured
.This also introduces a number of changes:
The
'resource finally
type is renamed to'resource template
.The
'resource moveable
type is renamed to'resource instance
.The semantics of
let^
is changed such that it also releases the resource in case an exception has been raised in the scope.A borrow mechanism is added, as the
let&
binding operator, to allow one to use a resource acquired as a'resource instance
before moving the resource to another scope.A way to explicitly
release
the resource held by aninstance
movable is also added.