def find_map_optional(self, fa: List[A], tpe: Type[F], f: Callable[[A], F[B]], msg: CallByName = None) -> F[B]: a = fa.map(f).find(_.present) return a | (lambda: Optional.fatal(tpe).absent(call_by_name(msg)))
def flat_m(self, v): return call_by_name(v) if self else maybe.Empty()
def m(self, v): return maybe.Maybe(call_by_name(v)) if self else maybe.Empty()
def get_or_fail(self, err): return self.get_or_raise(Exception(call_by_name(err)))
def get_or_fail(self, err: 'CallByName') -> 'A': # line 75 return _coconut_tail_call(self.get_or_raise, lambda: Exception(call_by_name(err))) # line 76
def raise_e() -> None: raise call_by_name(e)
def iff_m(cond: bool, a: Union['Maybe[A]', Callable[[], 'Maybe[A]']]) -> 'Maybe[A]': return cast(Maybe, call_by_name(a)) if cond else Nothing
def c(self, t, f): return call_by_name(t) if self.value else call_by_name(f)
def find_map_optional(self, fa: List[A], tpe: Type[F], f: Callable[[A], F[B]], msg: CallByName=None) -> F[B]: for el in fa: found = f(el) if found.present: return found return Optional.fatal(tpe).absent(call_by_name(msg))
def find_map_optional(self, fa: Either[A, B], tpe: Type[F], f: Callable[[B], F[C]], msg: CallByName=None) -> F[C]: return fa / f | (lambda: fa.absent(call_by_name(msg)))
def cata(self, f: 'Callable[[A], B]', b: 'Union[B, Callable[[], B]]') -> 'B': # line 55 return (f(cast(A, self._get)) if self.is_just else call_by_name(b)) # line 56
def iff_m(cond: 'bool', a: "Union['Maybe[A]', Callable[[], 'Maybe[A]']]") -> "'Maybe[A]'": # line 48 return cast(Maybe, call_by_name(a)) if cond else Nothing # line 49
def iff(cond: 'bool', a: 'Union[A, Callable[[], A]]') -> "'Maybe[A]'": # line 43 return cast(Maybe, Just(call_by_name(a))) if cond else Nothing # line 44
def e(self, l, r): return Right(call_by_name(r)) if self else Left(call_by_name(l))
def e(self, f: A, t: B) -> Either[A, B]: return Right(call_by_name(t)) if self else Left(call_by_name(f))
def flat_e(self, l, r): return call_by_name(r) if self else Left(call_by_name(l))
def cata(self, f: Callable[[Node], A], b: Union[A, Callable[[], A]]) -> A: return (f(self.data) if isinstance(self, SubTreeValid) else call_by_name(b))
def iff(cond: bool, a: Union[A, Callable[[], A]]) -> 'Maybe[A]': return cast(Maybe, Just(call_by_name(a))) if cond else Nothing
def iff_l(cond: bool, a: Union[A, Callable[[], A]]) -> List[A]: return call_by_name(a) if cond else List()
def cata(self, f: Callable[[A], B], b: Union[B, Callable[[], B]]) -> B: return (f(cast(A, self._get)) if self.is_just else call_by_name(b))
async def unsafe_await_or(self, b: Union[B, Callable[[], B]]): return (Maybe(await (self._get)) if self.is_just # type: ignore else call_by_name(b))
def get_or_fail(self, err: CallByName) -> A: return self.get_or_raise(lambda: Exception(call_by_name(err)))
def raise_e() -> 'None': # line 71 raise call_by_name(e) # line 72