map<R> method
Maps this Capsule (of type T
) into
a new idempotent Capsule (of type R
)
by applying the given mapper
.
This is similar to .select()
in some other libraries.
Implementation
Capsule<R> map<R>(R Function(T) mapper) {
return (CapsuleReader use) => mapper(use(this));
}