Skip to main content
Module

x/fun/array.ts>getSemigroup

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function getSemigroup
import { getSemigroup } from "https://deno.land/x/fun@v2.0.0-alpha.6/array.ts";

Create a Free semigroup over a type A using Array.concat.

Examples

Example 1

import * as A from "./array.ts";
import { pipe } from "./fn.ts";

const { concat } = A.getSemigroup<number>();

const result = pipe(
  [1, 2, 3],
  concat([4, 5, 6]),
); // [1, 2, 3, 4, 5, 6]

Returns

Semigroup<ReadonlyArray<A>>