acquire
a resource and you use the handle to
release the resource.
acquire
and Handle.release
are the low-level interface to accessing the resource.
These should be used carefully: to make sure you do not resource leak you need to
call Handle.release
at least once on every handle returned by acquire
. To ensure
safety you also must stop using the 'a
after having called release
on a
corresponding handle.
create
is the low-level way of creating resources.
Think of create
and acquire
as inverses: create
wraps the resource
implementation and acquire
exposes it:
1. acquire (create f) = f ()
2. create (fun () -> acquire r) = r