Show / Hide Table of Contents

    Class Optional

    Provides static utilities for Optional.
    Inheritance
    System.Object
    Optional
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Maki
    Assembly: Maki.dll
    Syntax
    public static class Optional
    Examples
    The following example shows how to use the Optional utilities for more expressive optional initialization.
    Optional<int> optional = Optional.Make(42);
    // equivalent of calling new Optional<int>(42)
    
    Optional<int> empty = Optional.Nothing;
    // equivalent of calling new Optional<int>()

    Fields

    | Improve this Doc View Source

    Nothing

    Represents an empty Optional. Any empty optional stores a Unit.
    Declaration
    public static Unit Nothing
    Field Value
    Type Description
    Unit

    Methods

    | Improve this Doc View Source

    Make<T>(T)

    Creates an Optional containing the given item.
    Declaration
    public static Optional<T> Make<T>(T item)
    Parameters
    Type Name Description
    T item Item to place in the Optional.
    Returns
    Type Description
    Optional<T> A new Optional containing an item of T.
    Type Parameters
    Name Description
    T Item type.
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX