Link Search Menu Expand Document

struct overview

Added in v2.10.0


Table of contents


instances

getAssignSemigroup

Return a semigroup which works like Object.assign.

Signature

export declare const getAssignSemigroup: <A extends object = never>() => Semigroup<A>

Example

import { getAssignSemigroup } from 'fp-ts/struct'

interface Person {
  readonly name: string
  readonly age: number
}

const S = getAssignSemigroup<Person>()
assert.deepStrictEqual(S.concat({ name: 'name', age: 23 }, { name: 'name', age: 24 }), { name: 'name', age: 24 })

Added in v2.10.0