Result
containing Option
.
import { optResToResOpt, some, none } from "./option.ts";
import { err, ok } from "./result.ts";
import { assertEquals } from "../deps.ts";
assertEquals(optResToResOpt(some(ok(5))), ok(some(5)));
assertEquals(optResToResOpt(none()), ok(none()));
assertEquals(optResToResOpt(some(err(5))), err(5));
Generated using TypeDoc
Transforms
Option<Result<E, T>>
intoResult<E, Option<T>>
as:none()
will be mapped took(none())
some(ok(x))
will be mapped took(some(x))
some(err(e))
will be mapped toerr(e)
.