Classes and functions for functional programming.
Getter
(*args, domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None, target: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None)¶Bases: flib.base.operator.Operator
Class for Getters.
A getter essentially is the composition of a fetch operation, that specifies the fields of a given domain type and a subsequent representation of the fetched fields as an object of given target type, by using the target frame (if given) as field identifiers.
Parameters: 


Identity
(domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None)¶Bases: flib.base.operator.Operator
Class for identity operators.
Parameters:  domain – 

Lambda
(expression: str = '', domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None, variables: Tuple[str, ...] = (), default: Optional[Callable[[...], Any]] = None, compile: bool = True)¶Bases: flib.base.operator.Operator
Class for operators, that are based on arithmetic expressions.
Parameters: 


variables
¶Operator
(*args, domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None, target: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None)¶Bases: collections.abc.Callable
, flib.base.abc.Multiton
Abstract Base Class for operators.
Parameters: 


domain
¶target
¶Vector
(*args, domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None, target: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None, default: Optional[Callable[[...], Any]] = None)¶Bases: collections.abc.Sequence
, flib.base.operator.Operator
Class for vectorial functions.
Parameters: 


components
¶fields
¶Zero
(target: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None)¶Bases: flib.base.operator.Operator
Class for zero operators.
A zero operator (or zero morphism) maps all given arguments to the zero object (empty object) of a given target category.
Parameters:  target – Optional target category of the operator. If provided, the
target category must by given as a type , like
int , float , str , set ,
tuple , list , dict or object .
Then the returned operator maps all objects of any domain category
to the zero object of the target category. By default the used zero
object is None. 

compose
(*args, unpack: bool = False) → Callable[[...], Any]¶Compose operators.
Parameters:  *args – Operators, which shall be composed. If provided, any given operator is required to be a callable or None. 

Returns:  Composition of all arguments, that do not evaluate to False. If all arguments evaluate to False, the identity operator is returned. 
create_aggregator
(*args, domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None, target: type = <class 'tuple'>) → Callable[[Sequence[Any]], Any]¶Creates an aggregation operator with specified variables.
Parameters: 


Return:
create_group_aggregator
(*args, key: Union[Hashable, Tuple[Hashable, ...], None] = None, domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None, target: type = <class 'tuple'>, presorted: bool = False) → Callable[[Sequence[Any]], Any]¶Creates a group aggregation operator.
Parameters: 


Returns:
create_grouper
(*args, domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None, presorted: bool = False) → Callable[[Sequence[Any]], Any]¶Create a grouping operator with fixed grouping keys.
Parameters: 


Returns:  List of sequences containing objects of a given domain typr, which are equal with respect to given grouping keys. 
create_setter
(*args, domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = <class 'object'>) → Callable[[...], Any]¶Create a setter operator.
Parameters: 


create_sorter
(*args, domain: Union[type, None, Tuple[Optional[type], Tuple[Hashable, ...]], Domain] = None, reverse: bool = False) → Callable[[Sequence[Any]], Sequence[Any]]¶Create a sorter with fixed sorting keys.
Sorters are operators, that act on sequences of objects of a given category and change the order of the objects within the sequence.
Parameters: 


Returns:  Callable function which sorts a sequence of objects of a given domain by given sorting keys. 
create_wrapper
(**attrs) → Callable[[...], Any]¶Create a function wrapper that adds attributes.
Parameters:  **attrs – Arbitrary keyword arguments 

Returns:  Function wrapper for given function, with additional specified attributes. 