Skip to main content
Module

x/fun/mod.ts>async_either.fromAsync

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function async_either.fromAsync
import { async_either } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { fromAsync } = async_either;

Lift an always succeeding async computation (Async) into a AsyncEither.

Examples

Example 1

import * as AE from "./async_either.ts";
import * as A from "./async.ts";

const value = AE.fromAsync(A.wrap(1));

const result1 = await value(); // Right(1)

Type Parameters

A
optional
B = never

Parameters

ta: Async<A>