Snippets tagged computational workflows

  • Another tennis implementation

    Simple game of tennis... refactored after reading Richard Minerich blog post @http://richardminerich.com/2011/02/the-road-to-functional-programming-in-f-from-imperative-to-computation-expressions/

    3 people like this

    Posted: 12 years ago by Colin Bull

  • Disposable Scopes provided by scope {...} computational workflow.

    This snippet provides a builder for scope {...} computational workflow that returns a Scope object implementing System.IDisposable interface. All "use" bindings inside scope {...} workflow are kept from being disposed immediately when computation leaves scope. Instead, they are disposed only when resulting Scope object is disposed. This makes possible to access disposable outside the scope while it remains usable. This can be achieved by via return statement of workflow that can return, for example, a closure that encapsulates disposable. scope {...} return value is available through Value property of Scope object. Scopes may be nested through let! binding that means that nested scope will be disposed when the resulting scope is disposed.

    3 people like this

    Posted: 1 year ago by Crazy Monk