File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
3
- from functools import reduce
4
-
5
- from returns ._generated .pipeline import pipe
3
+ # We import from the source, becase otherwise we will have a circular import.
4
+ from returns ._generated .pipeline .pipe import _pipe
6
5
7
6
8
7
def _flow (instance , * functions ):
@@ -30,4 +29,4 @@ def _flow(instance, *functions):
30
29
- https://github.com/gcanti/fp-ts/blob/master/src/pipeable.ts
31
30
32
31
"""
33
- return pipe . _pipe (* functions )(instance )
32
+ return _pipe (* functions )(instance )
Original file line number Diff line number Diff line change 2
2
3
3
from typing import Union
4
4
5
- from returns ._generated .pipeline .pipe import _pipe as pipe # noqa: F401
6
5
from returns ._generated .pipeline .flow import _flow as flow # noqa: F401
7
- from returns ._generated .pipeline .pipeline import _pipeline as pipeline # noqa: F401
6
+ from returns ._generated .pipeline .pipe import _pipe as pipe # noqa: F401
8
7
from returns .io import IOResult
9
8
from returns .maybe import Maybe
10
9
from returns .primitives .exceptions import UnwrapFailedError
11
10
from returns .result import Result
12
11
12
+ from returns ._generated .pipeline .pipeline import ( # isort:skip # noqa: F401
13
+ _pipeline as pipeline ,
14
+ )
15
+
13
16
# Logical aliases:
14
17
_Unwrapable = Union [Result , Maybe , IOResult ]
15
18
@@ -34,6 +37,9 @@ def is_successful(container: '_Unwrapable') -> bool:
34
37
>>> is_successful(Failure(1))
35
38
False
36
39
40
+ This function can work with containers that support
41
+ :class:`returns.primitives.interfaces.Unwrapable` protocol.
42
+
37
43
"""
38
44
try :
39
45
container .unwrap ()
You can’t perform that action at this time.
0 commit comments