<?php
namespace nulib\php\iter;

use Generator;

trait TFiltrable {
  function applyFilter($filter): Generator {
    $filter = Filter::with($filter);
    foreach ($this as $value) {
      if ($filter->matchValue($value)) {
        yield $value;
      }
    }
  }
}
