Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

some

import { some } from "https://raw.githubusercontent.com/baetheus/fun/main/option.ts";

The some constructer takes any value and wraps it in the Some type.

@example
import type { Option } from "./option.ts";
import * as O from "./option.ts";

function fromNilable<A>(a: A | null | undefined): Option<A> {
  return a === null || a === undefined ? O.none : O.some(a);
}

const result1 = fromNilable(null); // None
const result2 = fromNilable(1); // Some<number>
function some<A>(value: A): Option<A>;
§
some<A>(value: A): Option<A>
[src]

§Type Parameters

§Parameters

§
value: A
[src]

§Return Type