Maybe<T>.from constructor

Maybe<T>.from(
  1. T? input
)

Factory for helping building a Maybe from a nullable input. It produces a Nothing if the input is null, and a Just otherwise

Implementation

factory Maybe.from(T? input) {
  if (input == null) {
    return Nothing<T>();
  } else {
    return Just<T>(input);
  }
}