partition method

  1. @override
(Option<T>, Option<T>) partition(
  1. bool f(
    1. T t
    )
)
override

Return a record. If this Option is a Some:

  • if f applied to its value returns true, then the tuple contains this Option as second value
  • if f applied to its value returns false, then the tuple contains this Option as first value Otherwise the tuple contains both None.

Implementation

@override
(Option<T>, Option<T>) partition(bool Function(T t) f) =>
    (filter((a) => !f(a)), filter(f));