FunSharp.Common/UpdateExtensions.cs
//--------------------------------------------------
/// <summary>
/// Return a new <see cref="Update{TCast}"/> if the
/// value in <paramref name="update" /> is an instance
/// of <typeparamref name="TCast"/>. 
/// </summary>
Return a new  if the
value in  is an instance
of .
Return a new if the value in is an instance of .
[NotNull]
        public static Update<TCast> OfType<T, TCast>(
            [NotNull] this Update<T> update,
            TypeHint<TCast> tHint = default) where TCast : T
        {
            if (update is null) throw new ArgumentNullException(nameof(update));
            return update.Bind(x => x is TCast result ? result.ToUpdate() : Update<TCast>.Ignore);
        }
[ NotNull ] public static Update < TCast > OfType < T , TCast > ( [ NotNull ] this Update < T > update , TypeHint < TCast > tHint = default ) where TCast : T { if ( update is null ) throw new ArgumentNullException ( nameof ( update ) ) ; return update . Bind ( x => x is TCast result ? result . ToUpdate ( ) : Update < TCast > . Ignore ) ; }
Return a new  if the
value in  is an instance
of .
Return a new if the value in is an instance of .
this
[NotNull]
tHint
TypeHint<TCast>