Skip to main content
Module

x/fun/mod.ts>array.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 array.getSemigroup
import { array } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { getSemigroup } = array;

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>>