Skip to content

Commit 3b67582

Browse files
committed
Fixes cit
1 parent 20f8d59 commit 3b67582

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

returns/_generated/pipeline/flow.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# -*- coding: utf-8 -*-
22

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
65

76

87
def _flow(instance, *functions):
@@ -30,4 +29,4 @@ def _flow(instance, *functions):
3029
- https://github.com/gcanti/fp-ts/blob/master/src/pipeable.ts
3130
3231
"""
33-
return pipe._pipe(*functions)(instance)
32+
return _pipe(*functions)(instance)

returns/pipeline.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
from typing import Union
44

5-
from returns._generated.pipeline.pipe import _pipe as pipe # noqa: F401
65
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
87
from returns.io import IOResult
98
from returns.maybe import Maybe
109
from returns.primitives.exceptions import UnwrapFailedError
1110
from returns.result import Result
1211

12+
from returns._generated.pipeline.pipeline import ( # isort:skip # noqa: F401
13+
_pipeline as pipeline,
14+
)
15+
1316
# Logical aliases:
1417
_Unwrapable = Union[Result, Maybe, IOResult]
1518

@@ -34,6 +37,9 @@ def is_successful(container: '_Unwrapable') -> bool:
3437
>>> is_successful(Failure(1))
3538
False
3639
40+
This function can work with containers that support
41+
:class:`returns.primitives.interfaces.Unwrapable` protocol.
42+
3743
"""
3844
try:
3945
container.unwrap()

0 commit comments

Comments
 (0)