defaultVal<T> function

Some<T> defaultVal <T>(
  1. Maybe<T> self,
  2. T v
)

Set a default value when it is None

Implementation

Some<T> defaultVal<T>(Maybe<T> self, T v) {
  if (self is None) {
    return Some(v);
  }
  return self;
}