How to use the pfun.List function in pfun

To help you get started, we’ve selected a few pfun examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github suned / pfun / tests / type_tests / negatives / list_bind_arguments.py View on Github external
def test() -> List[int]:
    return List(['1', '2', '3']).and_then(lambda x: List([x**2]))
github suned / pfun / tests / type_tests / negatives / list_bind_return_type.py View on Github external
def test() -> List[str]:
    return List(i for i in (1, 2, 3)).and_then(lambda x: List([x**2]))
github suned / pfun / tests / test_list.py View on Github external
        assert l.and_then(lambda v: List([v])) == l
github suned / pfun / tests / test_list.py View on Github external
def test_inequality(self, first, second):
        assume(first != second)
        assert List(first) != List(second)
github suned / pfun / tests / test_list.py View on Github external
def test_left_identity_law(self, v, f):
        assert List([v]).and_then(f) == f(v)
github suned / pfun / tests / test_list.py View on Github external
def test_empty(self):
        assert List().empty() == List()
github suned / pfun / tests / type_tests / positives / list_bind_arguments.py View on Github external
    return List(i for i in (1, 2, 3)).and_then(lambda x: List([x**2]))