Skip to content

Instantly share code, notes, and snippets.

View bryanedds's full-sized avatar

Bryan Edds bryanedds

View GitHub Profile
@bryanedds
bryanedds / Vsync.fs
Last active October 24, 2016 21:32
The 'Vsync' (AKA, 'Variable Synchronization') computation expression that coheres into the Sync comp. expr. when SYNC is #defined, and into the Async comp. expr. otherwise.
namespace YourNamespaceHere
open System
open System.Diagnostics
open System.Threading
open System.Threading.Tasks
/// The 'Sync' builder for evaluating expressions in a synchronous style to aid debugging.
type [<Sealed>] Sync () =
member inline this.Bind (x, f) = f x
member inline this.Return x = x