예제 #1
0
 def is_left(self) -> 'amino.Boolean':
     return boolean.Boolean(isinstance(self, Left))
예제 #2
0
 def left_contains(self, a: A) -> 'boolean.Boolean':
     return boolean.Boolean(self.is_left and self.__left_value == a)
예제 #3
0
 def is_right(self) -> 'amino.Boolean':
     return boolean.Boolean(isinstance(self, Right))
예제 #4
0
파일: maybe.py 프로젝트: yangyang202/DA_GP9
 def is_just(self) -> boolean.Boolean:
     return boolean.Boolean(isinstance(self, Just))
예제 #5
0
 def is_empty(self) -> 'boolean.Boolean':
     return boolean.Boolean(self.length == 0)
예제 #6
0
 def contains(self, value: A) -> 'boolean.Boolean':
     return boolean.Boolean(value in self)
예제 #7
0
 def forall(self, f: Callable[[A], bool]) -> 'boolean.Boolean':
     return boolean.Boolean(all(f(el) for el in self))