toMaybe method

Maybe<T> toMaybe()

Implementation

Maybe<T> toMaybe() {
  return visit<Maybe<T>>(
    left: (Object _) => None<T>(),
    right: (r) => Just<T>(r),
  );
}