Skip to content

Instantly share code, notes, and snippets.

View tallpeak's full-sized avatar

Aaron William West tallpeak

View GitHub Profile
// from http://stackoverflow.com/questions/21194565/null-coalescing-operator-in-f
// modified to support DBNull
open System
let inline isNull value = obj.ReferenceEquals(value, null)
let inline isDBNull value = obj.ReferenceEquals(value, DBNull.Value)
type NullCoalesce =
static member Coalesce(a: 'a option, b: 'a Lazy) = match a with Some a -> a | _ -> b.Value
static member Coalesce(a: 'a Nullable, b: 'a Lazy) = if a.HasValue then a.Value else b.Value
@tallpeak
tallpeak / Livecoding_and_IFsharp.ipynb
Last active August 29, 2015 14:11
Livecoding using IFsharp notebooks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.