from ramda.curry import curry """This functions takes two list and applies given function to it""" zip_with = curry(lambda f, xs1, xs2: [f(x, y) for x, y in zip(xs1, xs2)])
from ramda.curry import curry """This functions takes cross product of two list""" xprod = curry(lambda xs1, xs2: [[x, y] for y in xs2 for x in xs1])
from ramda.curry import curry """This functions applies function at given index""" update = curry( lambda i, v, xs: [v if i == ind else x for ind, x in enumerate(xs)])
from ramda.curry import curry equals = curry(lambda x, y: x == y)
from ramda.curry import curry """This functions takes two list and creates a dictionary with it""" zip_obj = curry(lambda key, val: dict(zip(key, val)))
from ramda.curry import curry map = curry(lambda f, xs: [f(x) for x in xs])
from ramda.curry import curry import builtins isinstance = curry(lambda type, v: builtins.isinstance(v, type))
from ramda.curry import curry """Returns a new list without values in the first argument""" a = [1, 2] b = [1, 2, 1, 3, 4] without = curry(lambda xs1, xs2: [x for x in xs2 if x not in xs1])
from ramda.curry import curry import re replace = curry(re.sub)
from ramda.curry import curry getitem = curry(lambda key, collection: collection[key])
from ramda.curry import curry filter = curry(lambda p, xs: [x for x in xs if p(x)])