monocle-ts-esm
Version:
A porting of scala monocle library to TypeScript
19 lines (18 loc) • 423 B
JavaScript
/**
* @since 1.6.0
*/
import { right, left, fold } from 'fp-ts-esm/Either';
import { fromEither, none, some } from 'fp-ts-esm/Option';
import { Prism } from './index.js';
const r = new Prism(fromEither, right);
/**
* @category constructor
* @since 1.6.0
*/
export const _right = () => r;
const l = new Prism(fold(some, () => none), left);
/**
* @category constructor
* @since 1.6.0
*/
export const _left = () => l;