forked from robinhilliard/pipes
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added then for elixir implementation and moved utils
- Loading branch information
1 parent
b9c5e27
commit 29489d4
Showing
11 changed files
with
89 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from .elixir_like import pipes, tap | ||
from .elixir_like import pipes, tap, then | ||
from .python_like import Pipe, PipeEnd, PipeStart, Tap, Then | ||
|
||
__all__ = ["pipes", "tap", "Pipe", "PipeEnd", "PipeStart", "Tap", "Then"] | ||
__all__ = ["pipes", "tap", "then", "Pipe", "PipeEnd", "PipeStart", "Tap", "Then"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .pipes import pipes, tap | ||
from .pipes import pipes, tap, then | ||
|
||
__all__ = ["pipes", "tap"] | ||
__all__ = ["pipes", "tap", "then"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import inspect | ||
import types | ||
from typing import Callable | ||
|
||
|
||
def is_lambda(f: Callable) -> bool: | ||
return isinstance(f, types.LambdaType) and f.__name__ == "<lambda>" | ||
|
||
|
||
def is_one_arg_lambda(f: Callable) -> bool: | ||
sig = inspect.signature(f) | ||
return is_lambda(f) and len(sig.parameters) == 1 |