Skip to content

Methods_T_CSharpx_MaybeExtensions

Moh.Hassan edited this page Oct 10, 2019 · 1 revision

MaybeExtensions Methods

The MaybeExtensions type exposes the following members.

Methods

 

Name Description
Public methodStatic member Bind(T1, T2) Invokes a function on this maybe value that itself yields a maybe.
Public methodStatic member Do(T)(Maybe(T), Action(T)) If contans a value executes an Action(T) delegate over it.
Public methodStatic member Do(T1, T2)(Maybe(Tuple(T1, T2)), Action(T1, T2)) If contans a value executes an Action(T1, T2) delegate over it.
Public methodStatic member FromJust(T) Extracts the element out of a Just(T) and returns a default value if its argument is Nothing(T).
Public methodStatic member FromJustOrFail(T) Extracts the element out of a Just(T) and throws an error if its argument is Nothing(T).
Public methodStatic member GetValueOrDefault(T) If contains a values returns it, otherwise returns noneValue.
Public methodStatic member IsJust(T) Returns true iffits argument is of the form Just(T).
Public methodStatic member IsNothing(T) Returns true iffits argument is of the form Nothing(T).
Public methodStatic member Map(T1, T2) Transforms this maybe value by using a specified mapping function.
Public methodStatic member MapValueOrDefault(T1, T2) If contains a values executes a mapping function over it, otherwise returns noneValue.
Public methodStatic member Match(T)(Maybe(T), Action(T), Action) Provides pattern matching using Action delegates.
Public methodStatic member Match(T1, T2)(Maybe(Tuple(T1, T2)), Action(T1, T2), Action) Provides pattern matching using Action delegates over maybe with tupled wrapped value.
Public methodStatic member MatchJust(T1, T2) Matches a value returning true and tupled value itself via two output parameters.
Public methodStatic member Select(TSource, TResult) Map operation compatible with Linq.
Public methodStatic member SelectMany(TSource, TValue, TResult) Bind operation compatible with Linq.
Public methodStatic member ToEnumerable(T) Returns an empty list when given Nothing(T) or a singleton list when given a Just(T).
Public methodStatic member ToMaybe(T) Equivalent to monadic Return(T)(T) operation. Builds a Just(T) value in case value is different from its default.
  Back to Top

See Also

Reference

MaybeExtensions Class
CSharpx Namespace

Clone this wiki locally