metadsl_core.function

This module is built on top of the abstraction

It adds the ability to have multiple arities and names attached to functions.

Because MyPy doesn’t support multiple arity generics, we need a seperate class for each arity of function.

Classes

FunctionOne(function, args, kwargs)

Function with one arg.

FunctionThree(function, args, kwargs)

Function with three args.

FunctionTwo(function, args, kwargs)

Function with two args.

FunctionZero(function, args, kwargs)

Function with zero args.

class metadsl_core.function.FunctionOne(function, args, kwargs)[source]

Function with one arg.

abstraction(self) = FunctionOne.abstraction[source]
args: List[object]
create(cls, name, val) = FunctionOne.create[source]
from_fn(cls, fn, name=metadsl_core.maybe.Maybe[str](Maybe.nothing, [], {})) = FunctionOne.from_fn[source]
from_fn_recursive(cls, fn) = FunctionOne.from_fn_recursive[source]
function: Callable
kwargs: Dict[str, object]
name(self) = FunctionOne.name[source]
unfix(self) = FunctionOne.unfix[source]
class metadsl_core.function.FunctionThree(function, args, kwargs)[source]

Function with three args.

abstraction(self) = FunctionThree.abstraction[source]
args: List[object]
create(cls, name, val) = FunctionThree.create[source]
from_fn(cls, fn) = FunctionThree.from_fn[source]
from_fn_recursive(cls, fn) = FunctionThree.from_fn_recursive[source]
function: Callable
kwargs: Dict[str, object]
name(self) = FunctionThree.name[source]
unfix(self) = FunctionThree.unfix[source]
class metadsl_core.function.FunctionTwo(function, args, kwargs)[source]

Function with two args.

abstraction(self) = FunctionTwo.abstraction[source]
args: List[object]
create(cls, name, val) = FunctionTwo.create[source]
from_fn(cls, fn) = FunctionTwo.from_fn[source]
from_fn_recursive(cls, fn) = FunctionTwo.from_fn_recursive[source]
function: Callable
kwargs: Dict[str, object]
name(self) = FunctionTwo.name[source]
unfix(self) = FunctionTwo.unfix[source]
class metadsl_core.function.FunctionZero(function, args, kwargs)[source]

Function with zero args.

args: List[object]
create(cls, name, val) = FunctionZero.create[source]
from_fn(cls, fn) = FunctionZero.from_fn[source]
function: Callable
kwargs: Dict[str, object]
name(self) = FunctionZero.name[source]
property value: metadsl_core.function.T
Return type

TypeVar(T)