Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function _right(): Prism, These> { return Prism.fromPredicate(s => s.type === "Right"); }
export const bar: FooBar = { type: "Bar" };
export function fold(fa: FooBar, onFoo: R, onBar: R): R { switch (fa.type) {
case "Foo": return onFoo;
case "Bar": return onBar;
} }
export function foldL(fa: FooBar, onFoo: () => R, onBar: () => R): R { switch (fa.type) {
case "Foo": return onFoo();
case "Bar": return onBar();
} }
import { Prism } from "monocle-ts";
export const _Foo: Prism = Prism.fromPredicate(s => s.type === "Foo");
export const _Bar: Prism = Prism.fromPredicate(s => s.type === "Bar");
export function _right(): Prism, Either> { return Prism.fromPredicate(s => s.type === "Right"); }
export function _just<a>(): Prism, Maybe</a><a>> { return Prism.fromPredicate(s => s.type === "Just"); }
</a>
export function _fetching<a>(): Prism, Constrained</a><a>> { return Prism.fromPredicate(s => s.type === "Fetching"); }
</a>
export const createRangePrism = (from: number, to: number): Prism => {
return Prism.fromPredicate(n => n >= from && n <= to)
}
export function _nothing<a>(): Prism, Maybe</a><a>> { return Prism.fromPredicate(s => s.type === "Nothing"); }
</a>
export function _left(): Prism, Either> { return Prism.fromPredicate(s => s.type === "Left"); }
export function _leaf<a>(): Prism, Tree</a><a>> { return Prism.fromPredicate(s => s.type === "Leaf"); }
</a>
export function _none<a>(): Prism, Option</a><a>> { return Prism.fromPredicate(s => s.type === "None"); }
</a>