toMaybe method

Maybe<T> toMaybe()

Implementation

Maybe<T> toMaybe() {
  if (this == null) {
    return const Nothing();
  } else {
    return Just(this as T);
  }
}