예제 #1
0
 def __eq_test__(self, other, data):
     return self.match(
         Left=lambda x: other.match(
             Left=lambda y: eq_test(x, y, data=data),
             Right=lambda _: False,
         ),
         Right=lambda x: other.match(
             Left=lambda _: False,
             Right=lambda y: eq_test(x, y, data=data),
         ),
     )
예제 #2
0
 def __eq_test__(self, other, data=None):
     return self.match(
         Nil=lambda: other.match(
             Nil=lambda: True,
             Cons=lambda _, __: False,
         ),
         Cons=lambda x, lxs: other.match(
             Nil=lambda: False,
             Cons=lambda y, lys: (
                 eq_test(x, y, data) and
                 eq_test(lxs(), lys(), data)
             ),
         ),
     )
예제 #3
0
 def __eq_test__(self, other, data):
     return self.match(
         Nothing=lambda: other.match(
             Nothing=lambda: True,
             Just=lambda _: False,
         ),
         Just=lambda x: other.match(
             Nothing=lambda: False,
             Just=lambda y: eq_test(x, y, data),
         ),
     )
예제 #4
0
 def __eq_test__(self, other, data=None):
     return (self.__dict.keys() == other.__dict.keys() and all(
         testing.eq_test(self.__dict[key], other.__dict[key], data)
         for key in self.__dict.keys()))
예제 #5
0
 def __eq_test__(self, other, data=None):
     return (False if len(self.__xs) != len(other.__xs) else all(
         eq_test(x, y, data) for (x, y) in zip(self.__xs, other.__xs)))
예제 #6
0
 def __eq_test__(self, other, data, input_strategy=st.integers()):
     x = data.draw(input_strategy)
     return eq_test(self.app_endo(x), other.app_endo(x), data)
예제 #7
0
 def __eq_test__(self, other, data):
     return eq_test(self.decomposed, other.decomposed, data)
예제 #8
0
파일: identity.py 프로젝트: jluttine/haskpy
 def __eq_test__(self, other, data):
     return eq_test(self.x, other.x, data)