import * as ahh from "https://deno.land/x/ahh@v0.12.1/src/option.ts";
Contains an idiomatic Option
type and related functions.
The types and functions provided in this module likely follow how you already
handle optional values yourself. A quick look at what the Option
type boils down to shows how simple it is:
type Option<T> = (undefined | null) | T;
Almost all built-in and external modules handle the none side as
undefined
or null
, and the some side as the value itself. This is
exactly the same as what the type above defines.
Since optionals are not special, we still have access to the features built into the language, such as:
This module simply provides extra functionality on-top of these.