Some<T> Class

Summary

Represents an option type with a value of T.
Namespace
FunctionalSharp.OptionTypes
Interfaces
  • IOption<T>
Base Types
  • object
graph TD Base0["object"]-->Type Interface0["IOption<T>"]-.->Type Type["Some<T>"] class Type type-node

Syntax

[Serializable]
public class Some<T> : IOption<T>

Attributes

Type Description
SerializableAttribute

Type Parameters

Name Description
T

Methods

Name Value Summary
IfNotNullDo(Action<T>) void
Performs the action with the value.
Match(Action<T>, Action) void
performs the withvalue action.
Match<TResult>(Func<T, TResult>, Func<TResult>) TResult
Performas the withvalue function.
Match<TResult>(Func<T, TResult>, TResult) TResult
performs the withvalue function to get a value of TResult.
ToNullable() T
returns the value of T.
ToString() string
returns the tostring method of T.

Extension Methods

Name Value Summary
Match<Some<T>>() PatternMatchSingleContext<T>
Starts a pattern match for a single value. Subsequent calls to With() need to be used to specify conditions
ToOption<Some<T>>() IOption<T>
Turns the type T into an option type.