maybeCompose

Compose two Functions f and g where f emits a Maybe!B and g takes a B.

maybeCompose
(
F
G
)
(
F f
,
G g
)

Examples

auto c = RealFunction!(collatz!int).get;
auto lc = c.maybeCompose(c).maybeCompose(c);
auto rc = c.maybeCompose(c.maybeCompose(c));
foreach (i; 0..10)
	assert (lc(i).maybeEqual(rc(i)));

Meta