Module

x/functional/mod.ts>evert

Common Functional Programming Algebraic data types for JavaScript that is compatible with most modern browsers and Deno.
Latest
variable evert
import { evert } from "https://deno.land/x/functional@v1.3.4/mod.ts";

evert

Applicative a => a -> a[] -> a

This function takes a type constructor and, a list of Applicative functor and evert it; effectively making an Applicative functor of a list of value.

import Task from "https://deno.land/x/functional@v1.3.2/library/Task.js";
import { evert } from "https://deno.land/x/functional@v1.3.2/library/utilities.js";

const container = await evert(Task, [ Task.of(42), Task.of(32), Task.of(24) ]).run();

const list = safeExtract("Failed.", container);

assertEquals(list, [ 42, 32, 24 ]);