1
1
from typing import Callable , TypeVar
2
2
3
- from returns .interfaces .filterable import Filterable
4
- from returns .primitives .hkt import Kind1 , Kinded , kinded
3
+ from returns .interfaces .filterable import FilterableN
4
+ from returns .primitives .hkt import Kinded , KindN , kinded
5
5
6
- _InnerType = TypeVar ('_InnerType' )
7
- _FilterableKind = TypeVar ('_FilterableKind' , bound = Filterable )
6
+ _FirstType = TypeVar ('_FirstType' )
7
+ _SecondType = TypeVar ('_SecondType' )
8
+ _ThirdType = TypeVar ('_ThirdType' )
9
+ _FilterableKind = TypeVar ('_FilterableKind' , bound = FilterableN )
8
10
9
11
10
12
def filter_ (
11
- predicate : Callable [[_InnerType ], bool ],
13
+ predicate : Callable [[_FirstType ], bool ],
12
14
) -> Kinded [Callable [
13
- [Kind1 [_FilterableKind , _InnerType ]],
14
- Kind1 [_FilterableKind , _InnerType ],
15
+ [KindN [_FilterableKind , _FirstType , _SecondType , _ThirdType ]],
16
+ KindN [_FilterableKind , _FirstType , _SecondType , _ThirdType ],
15
17
]]:
16
18
"""
17
19
Applies predicate over container.
@@ -32,8 +34,8 @@ def filter_(
32
34
33
35
@kinded
34
36
def factory (
35
- container : Kind1 [_FilterableKind , _InnerType ],
36
- ) -> Kind1 [_FilterableKind , _InnerType ]:
37
+ container : KindN [_FilterableKind , _FirstType , _SecondType , _ThirdType ],
38
+ ) -> KindN [_FilterableKind , _FirstType , _SecondType , _ThirdType ]:
37
39
return container .filter (predicate )
38
40
39
41
return factory
0 commit comments