libfunc: functional-programming helping tools
Tools for Functional-Programming in Python.
From: https://github.com/joaomcteixeira/libfuncpy
- haddock.libs.libfunc.chainf(init: Any, *funcs: Callable[[...], Any], **common: Any) Any [source]
Apply a sequence of functions to an initial value.
Example
>>> chainf(2, *[str, int, float]) 2.0
- Parameters:
init (anything) – The initial value.
**common (keyword arguments) – Common key word arguments to all functions.
- Returns:
anything – The result of the chain of functions; this is, the return value of the last function.
- haddock.libs.libfunc.chainfs(*funcs: Callable[[...], Any], **common: Any) Callable[[...], Any] [source]
Store functions be executed on a value.
Example
>>> do = chainfs(str, int, float) >>> do(2) 2.0
See also
- haddock.libs.libfunc.false(*ignore: Any, **everything: Any) Literal[False] [source]
Give False regardless of the input.
- haddock.libs.libfunc.nan(*ignore: Any, **everything: Any) float [source]
Give nan regardless of the input.
- haddock.libs.libfunc.none(*ignore: Any, **everything: Any) Literal[None] [source]
Give None regardless of the input.