import { some } from "https://deno.land/x/fun@v2.0.0-alpha.10/optics.ts";
A preconstructed composed prism that focuses on the Some value of an Option.
Examples
Example 1
Example 1
import * as O from "./optics.ts";
import { Option, some, none } from "./option.ts";
import { pipe } from "./fn.ts";
type Person = { name: string, talent: Option<string> };
type People = readonly Person[]
const talent = pipe(O.id<People>(), O.array, O.prop("talent"), O.some);
const brandon: Person = { name: "Brandon", talent: none };
const emily: Person = { name: "Emily", talent: some("Knitting") };
const result = pipe(talent, O.view([brandon, emily])); // ["Knitting"];