Skip to content

Commit

Permalink
bla 2
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-pl committed Nov 4, 2024
1 parent fd17365 commit 5db5477
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion rdfproxy/checks/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@
check_select_query,
check_solution_modifiers,
)
from toolz import compose_left


T = TypeVar("T")
_TCheck = Callable[[T], T | NoReturn]


def compose_left(*fns: Callable) -> Callable:
def _left_wrapper(*fns):
fn, *rest_fns = fns

if rest_fns:
return lambda *args, **kwargs: fn(_left_wrapper(*rest_fns)(*args, **kwargs))
return fn

return _left_wrapper(*reversed(fns))


def compose_checker(*checkers: _TCheck) -> _TCheck:
return compose_left(*checkers)

Expand Down

0 comments on commit 5db5477

Please sign in to comment.