Show / Hide Table of Contents
  • MaybeSharp
    • Maybe<T>
      • As
      • Bind
      • Cast
      • CompareTo
      • Equality
      • Equals
      • Explicit
      • GetHashCode
      • GreaterThan
      • GreaterThanOrEqual
      • HasValue
      • Implicit
      • Inequality
      • IsEmpty
      • LessThan
      • LessThanOrEqual
      • Maybe
      • Nothing
      • ToString
      • Value
  • MaybeSharp.Extensions
    • MaybeDictionaryExtensions
      • TryGetValue
    • MaybeExtensions
      • Coalesce
      • Or
      • Select
      • SelectMany
      • SelectNonempty
      • ToNullable
      • ValueOr
      • ValueOrException
      • WhenNothing
      • WhenSomething
      • Where
    • MaybeStringExtensions
      • TryParseBoolean
      • TryParseByte
      • TryParseChar
      • TryParseDateTime
      • TryParseDateTimeOffset
      • TryParseDecimal
      • TryParseDouble
      • TryParseInt
      • TryParseInt16
      • TryParseInt64
      • TryParseSingle
    • NullableExtensions
      • ToMaybe

Method Bind

Bind(Func<T, Maybe<T>>)

If this maybe is not empty, calls the specified function providing the value of this maybe and returns the result. If this maybe is nothing, returns an empty maybe.

Declaration
public Maybe<T> Bind(Func<T, Maybe<T>> func)
Parameters
Type Name Description
Func<T, Maybe<T>> func

The function to call if this maybe is not empty.

Returns
Type Description
Maybe<T>

A Maybe{T}. Will be an empty maybe if this maybe is empty.

Bind<TResult>(Func<T, Maybe<TResult>>)

If this maybe is not empty, calls the specified function providing the value of this maybe and returns the result. If this maybe is nothing, returns an empty maybe.

Declaration
public Maybe<TResult> Bind<TResult>(Func<T, Maybe<TResult>> func)
Parameters
Type Name Description
Func<T, Maybe<TResult>> func

The function to call if this maybe is not empty.

Returns
Type Description
Maybe<TResult>

A Maybe{TResult}. Will be an empty maybe if this maybe is empty.

Type Parameters
Name Description
TResult

The type of value returned from the provided function.

Back to top Copyright (c) 2017 Troy Willmot