Struct Option<T>
  
  
  
  
  
    Inherited Members
    
      System.ValueType.ToString()
    
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.GetType()
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
   
  
  Assembly: LibSugar.dll
  Syntax
  
    public struct Option<T> : IBox<T>, IEquatable<Option<T>>
   
  Type Parameters
  
  Constructors
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Option(T)
  
  
  Declaration
  
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | T | 
        val | 
         | 
      
    
  
  Properties
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Has
  
  
  Declaration
  
    public readonly bool Has { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  IsNone
  
  
  Declaration
  
    public readonly bool IsNone { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  IsSome
  
  
  Declaration
  
    public readonly bool IsSome { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  None
  
  
  Declaration
  
    public static readonly Option<T> None { get; }
   
  Property Value
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Value
  
  
  Declaration
  
    public readonly T Value { get; }
   
  Property Value
  
  Methods
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  And<U>(Option<U>)
  
  
  Declaration
  
    public Option<U> And<U>(Option<U> o)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Option<U> | 
        o | 
         | 
      
    
  
  Returns
  
  Type Parameters
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Equals(Option<T>)
  
  
  Declaration
  
    public bool Equals(Option<T> other)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Option<T> | 
        other | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Equals(Object)
  
  
  Declaration
  
    public override bool Equals(object obj)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Object | 
        obj | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  Overrides
  System.ValueType.Equals(System.Object)
  
    |
    Improve this Doc
  
  
    View Source
  
  
  GetHashCode()
  
  
  Declaration
  
    public override int GetHashCode()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Int32 | 
         | 
      
    
  
  Overrides
  System.ValueType.GetHashCode()
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Map<U>(Func<T, U>)
  
  
  Declaration
  
    public Option<U> Map<U>(Func<T, U> f)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Func<T, U> | 
        f | 
         | 
      
    
  
  Returns
  
  Type Parameters
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Or(Option<T>)
  
  
  Declaration
  
    public Option<T> Or(Option<T> o)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Option<T> | 
        o | 
         | 
      
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Or(Func<Option<T>>)
  
  
  Declaration
  
    public Option<T> Or(Func<Option<T>> o)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Func<Option<T>> | 
        o | 
         | 
      
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Replace(Option<T>)
  
  
  Declaration
  
    public Option<T> Replace(Option<T> o)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Option<T> | 
        o | 
         | 
      
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Some(T)
  
  
  Declaration
  
    public static Option<T> Some(T val)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | T | 
        val | 
         | 
      
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Take()
  
  
  Declaration
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Then<U>(Func<T, Option<U>>)
  
  
  Declaration
  
    public Option<U> Then<U>(Func<T, Option<U>> f)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Func<T, Option<U>> | 
        f | 
         | 
      
    
  
  Returns
  
  Type Parameters
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Xor(Option<T>)
  
  
  Declaration
  
    public Option<T> Xor(Option<T> o)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Option<T> | 
        o | 
         | 
      
    
  
  Returns
  
  Operators
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  BitwiseAnd(Option<T>, Option<T>)
  
  
  Declaration
  
    public static Option<T> operator &(Option<T> left, Option<T> right)
   
  Parameters
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  BitwiseOr(Option<T>, Option<T>)
  
  
  Declaration
  
    public static Option<T> operator |(Option<T> left, Option<T> right)
   
  Parameters
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Equality(Option<T>, Option<T>)
  
  
  Declaration
  
    public static bool operator ==(Option<T> left, Option<T> right)
   
  Parameters
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  ExclusiveOr(Option<T>, Option<T>)
  
  
  Declaration
  
    public static Option<T> operator ^(Option<T> left, Option<T> right)
   
  Parameters
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Inequality(Option<T>, Option<T>)
  
  
  Declaration
  
    public static bool operator !=(Option<T> left, Option<T> right)
   
  Parameters
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  Implements
  
  
      System.IEquatable<T>
  
  Extension Methods
  
      Sugar.Borrow<T>(T)
  
  
      Sugar.Owner<T>(T)