Resource
public class Resource<F, A> : ResourceOf<F, A> where F : Bracket
Resource models resource allocation and releasing. It is specially useful when multiple resources that depend on each other need to be acquired and later released in reverse order. Whn a resource is created, one can make use of the use method to run a computation with the resource. The finalizers are guaranteed to run afterwards in reverse order of acquisition.
-
Safe downcast.
Declaration
Swift
public static func fix(_ value: ResourceOf<F, A>) -> Resource<F, A>Parameters
valueValue in higher kinded form.
Return Value
Value casted to Resource.
-
Initializes a resource.
Declaration
Parameters
acquireFunction to acquire the resource.
releaseFunction to release the resource.
Return Value
A Resource that will run the provided functions to acquire and release it.
-
Undocumented
Declaration
Swift
public func combine(_ other: Resource<F, A>) -> Resource<F, A>
-
Undocumented
Declaration
Swift
public static func empty() -> Resource<F, A>
Install in Dash
Resource Class Reference