Table of Contents

Interface IOptionalTypeShape<TOptional, TElement>

Namespace
PolyType.Abstractions
Assembly
PolyType.dll

Provides a strongly typed shape model for optional types.

public interface IOptionalTypeShape<TOptional, TElement> : ITypeShape<TOptional>, IOptionalTypeShape, ITypeShape

Type Parameters

TOptional

The optional type described by the shape.

TElement

The value encapsulated by the option type.

Inherited Members

Remarks

Examples of optional types include Nullable<T> or the F# option types.

Properties

ElementType

Gets the shape of the underlying value type.

ITypeShape<TElement> ElementType { get; }

Property Value

ITypeShape<TElement>

Methods

GetDeconstructor()

Gets a deconstructor delegate for TOptional instances.

OptionDeconstructor<TOptional, TElement> GetDeconstructor()

Returns

OptionDeconstructor<TOptional, TElement>

A delegate for deconstructing TOptional instances.

GetNoneConstructor()

Gets a constructor for creating empty (aka 'None') instances of TOptional.

Func<TOptional> GetNoneConstructor()

Returns

Func<TOptional>

A delegate for creating empty (aka 'None') instances of TOptional.

GetSomeConstructor()

Gets a constructor for creating populated (aka 'Some') instances of TOptional.

Func<TElement, TOptional> GetSomeConstructor()

Returns

Func<TElement, TOptional>

A delegate for creating populated (aka 'Some') instances of TOptional.