fp-ts-std
Version:
The missing pseudo-standard library for fp-ts.
11 lines (10 loc) • 571 B
JavaScript
import * as TE from "fp-ts/TaskEither";
import { flow, identity } from "fp-ts/function";
import { runReader } from "./Reader";
import { unsafeUnwrapLeft as unsafeUnwrapLeftTE, unsafeUnwrap as unsafeUnwrapTE, } from "./TaskEither";
export const runReaderTaskEither = runReader;
export const unsafeUnwrap = (rte) => (r) => unsafeUnwrapTE(rte(r));
export const unsafeUnwrapLeft = (rte) => (r) => unsafeUnwrapLeftTE(rte(r));
export const asksEither = (f) => flow(f, TE.fromEither);
export const asksTask = (f) => flow(f, TE.fromTask);
export const asksTaskEither = identity;