map<R> method Null safety

  1. @override
DiscreteDistribution<R> map<R>(
  1. R f(
    1. T value
    ),
  2. {T reverse(
    1. R value
    )?}
)
override

Maps the distribution with the given function.

Reverse function

You can optionally define a reverse function. If you don't define reverse function, pmf will throw UnsupportedError.

Implementation

@override
DiscreteDistribution<R> map<R>(R Function(T value) f,
    {T Function(R value)? reverse}) {
  return _MappedDiscreteDistribution<T, R>(this, f, reverse);
}