Function
noneIn
(
self: List<A>,
predicate: Predicate<A>,
isFlipped: boolean
)
Source from the content-addressed store, hash-verified
| 498 | |
| 499 | // everything seen so far is not included |
| 500 | const noneIn = <A>( |
| 501 | self: List<A>, |
| 502 | predicate: Predicate<A>, |
| 503 | isFlipped: boolean |
| 504 | ): List<A> => { |
| 505 | while (true) { |
| 506 | if (isNil(self)) { |
| 507 | return _Nil |
| 508 | } else { |
| 509 | if (predicate(self.head) !== isFlipped) { |
| 510 | return allIn(self, self.tail, predicate, isFlipped) |
| 511 | } else { |
| 512 | self = self.tail |
| 513 | } |
| 514 | } |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | // everything from 'start' is included, if everything from this point is in we can return the origin |
| 519 | // start otherwise if we discover an element that is out we must create a new partial list. |
Tested by
no test coverage detected