Protected part of ``loop`` method. Can be replaced in subclasses for better performance, etc.
(
cls,
iterable: Iterable[
KindN[_ApplicativeKind, _FirstType, _SecondType, _ThirdType],
],
acc: KindN[_ApplicativeKind, _UpdatedType, _SecondType, _ThirdType],
function: Callable[
[_FirstType],
Callable[[_UpdatedType], _UpdatedType],
],
concat: Callable[
[
KindN[_ApplicativeKind, _FirstType, _SecondType, _ThirdType],
KindN[_ApplicativeKind, _UpdatedType, _SecondType, _ThirdType],
KindN[
_ApplicativeKind,
Callable[
[_FirstType],
Callable[[_UpdatedType], _UpdatedType],
],
_SecondType,
_ThirdType,
],
],
KindN[_ApplicativeKind, _UpdatedType, _SecondType, _ThirdType],
],
)
| 319 | |
| 320 | @classmethod |
| 321 | def _loop( |
| 322 | cls, |
| 323 | iterable: Iterable[ |
| 324 | KindN[_ApplicativeKind, _FirstType, _SecondType, _ThirdType], |
| 325 | ], |
| 326 | acc: KindN[_ApplicativeKind, _UpdatedType, _SecondType, _ThirdType], |
| 327 | function: Callable[ |
| 328 | [_FirstType], |
| 329 | Callable[[_UpdatedType], _UpdatedType], |
| 330 | ], |
| 331 | concat: Callable[ |
| 332 | [ |
| 333 | KindN[_ApplicativeKind, _FirstType, _SecondType, _ThirdType], |
| 334 | KindN[_ApplicativeKind, _UpdatedType, _SecondType, _ThirdType], |
| 335 | KindN[ |
| 336 | _ApplicativeKind, |
| 337 | Callable[ |
| 338 | [_FirstType], |
| 339 | Callable[[_UpdatedType], _UpdatedType], |
| 340 | ], |
| 341 | _SecondType, |
| 342 | _ThirdType, |
| 343 | ], |
| 344 | ], |
| 345 | KindN[_ApplicativeKind, _UpdatedType, _SecondType, _ThirdType], |
| 346 | ], |
| 347 | ) -> KindN[_ApplicativeKind, _UpdatedType, _SecondType, _ThirdType]: |
| 348 | """ |
| 349 | Protected part of ``loop`` method. |
| 350 | |
| 351 | Can be replaced in subclasses for better performance, etc. |
| 352 | """ |
| 353 | wrapped = acc.from_value(function) |
| 354 | for current in iterable: |
| 355 | acc = concat(current, acc, wrapped) |
| 356 | return acc |
| 357 | |
| 358 | |
| 359 | # Helper functions |
no test coverage detected