Exemplo n.º 1
0
 def is_left(self) -> 'amino.Boolean':
     return boolean.Boolean(isinstance(self, Left))
Exemplo n.º 2
0
 def left_contains(self, a: A) -> 'boolean.Boolean':
     return boolean.Boolean(self.is_left and self.__left_value == a)
Exemplo n.º 3
0
 def is_right(self) -> 'amino.Boolean':
     return boolean.Boolean(isinstance(self, Right))
Exemplo n.º 4
0
 def is_just(self) -> boolean.Boolean:
     return boolean.Boolean(isinstance(self, Just))
Exemplo n.º 5
0
 def is_empty(self) -> 'boolean.Boolean':
     return boolean.Boolean(self.length == 0)
Exemplo n.º 6
0
 def contains(self, value: A) -> 'boolean.Boolean':
     return boolean.Boolean(value in self)
Exemplo n.º 7
0
 def forall(self, f: Callable[[A], bool]) -> 'boolean.Boolean':
     return boolean.Boolean(all(f(el) for el in self))