11from typing import Callable , TypeVar
22
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
55
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 )
810
911
1012def filter_ (
11- predicate : Callable [[_InnerType ], bool ],
13+ predicate : Callable [[_FirstType ], bool ],
1214) -> Kinded [Callable [
13- [Kind1 [_FilterableKind , _InnerType ]],
14- Kind1 [_FilterableKind , _InnerType ],
15+ [KindN [_FilterableKind , _FirstType , _SecondType , _ThirdType ]],
16+ KindN [_FilterableKind , _FirstType , _SecondType , _ThirdType ],
1517]]:
1618 """
1719 Applies predicate over container.
@@ -32,8 +34,8 @@ def filter_(
3234
3335 @kinded
3436 def factory (
35- container : Kind1 [_FilterableKind , _InnerType ],
36- ) -> Kind1 [_FilterableKind , _InnerType ]:
37+ container : KindN [_FilterableKind , _FirstType , _SecondType , _ThirdType ],
38+ ) -> KindN [_FilterableKind , _FirstType , _SecondType , _ThirdType ]:
3739 return container .filter (predicate )
3840
3941 return factory
0 commit comments