public static string DefaultRightWithTests(object val, string defaultVal) { return((val is int a ? Either <int, string> .Left(a) : Either <int, string> .Right((string)val)) .Pipe(Either.DefaultRightWith <int, string>(defaultVal))); }