@effect-ts/system
Version:
Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.
12 lines (9 loc) • 292 B
text/typescript
// ets_tracing: off
import * as E from "../Either/index.js"
import { chain_, fail, succeed, succeedWith } from "./core.js"
/**
* Lifts an `Either` into a `Sync` value.
*/
export function fromEither<E, A>(f: () => E.Either<E, A>) {
return chain_(succeedWith(f), E.fold(fail, succeed))
}