Ferrous API Reference

All Types / Ferrous.Results

class Option

public static class Option

Convenience factory methods for creating Option<T> instances with type inference.

Methods

public static Option<T> Some<T>(T value)

Wraps value in Option<T>.Some.

public static Option<T> FromNullable<T>(T? value) where T : class

Converts a nullable reference into Some(value) when non-null, or None when null.

public static Option<T> FromNullable<T>(T? value) where T : struct

Converts a Nullable<T> into Some(value) when it has a value, or None otherwise.