let (|DefaultValue|) (defaultValue: 't) (input: 't) = if obj.Equals(input, Unchecked.defaultof<'t>) then defaultValue else input