Eq overview

This module is experimental

Experimental features are published in order to get early feedback from the community, see these tracking issues for further discussions and enhancements.

A feature tagged as Experimental is in a high state of flux, you’re at risk of it changing without notice.

Added in v2.2.2


Table of contents


combinators

array

Signature

export declare const array: <A>(eq: E.Eq<A>) => E.Eq<A[]>

Added in v2.2.2

intersect

Signature

export declare const intersect: <B>(right: E.Eq<B>) => <A>(left: E.Eq<A>) => E.Eq<A & B>

Added in v2.2.2

lazy

Signature

export declare function lazy<A>(f: () => Eq<A>): Eq<A>

Added in v2.2.2

nullable

Signature

export declare function nullable<A>(or: Eq<A>): Eq<null | A>

Added in v2.2.2

partial

Signature

export declare function partial<A>(properties: { [K in keyof A]: Eq<A[K]> }): Eq<Partial<{ [K in keyof A]: A[K] }>>

Added in v2.2.2

readonly

Signature

export declare const readonly: <A>(eq: E.Eq<A>) => E.Eq<Readonly<A>>

Added in v2.2.15

record

Signature

export declare const record: <A>(codomain: E.Eq<A>) => E.Eq<Record<string, A>>

Added in v2.2.2

struct

Signature

export declare const struct: <A>(eqs: { [K in keyof A]: E.Eq<A[K]> }) => E.Eq<{ [K in keyof A]: A[K] }>

Added in v2.2.15

sum

Signature

export declare function sum<T extends string>(
  tag: T
): <A>(members: { [K in keyof A]: Eq<A[K] & Record<T, K>> }) => Eq<A[keyof A]>

Added in v2.2.2

tuple

Signature

export declare const tuple: <A extends readonly unknown[]>(...components: { [K in keyof A]: E.Eq<A[K]> }) => E.Eq<A>

Added in v2.2.2

type

Use struct instead.

Signature

export declare const type: <A>(eqs: { [K in keyof A]: E.Eq<A[K]> }) => E.Eq<{ [K in keyof A]: A[K] }>

Added in v2.2.2

instances

Schemable

Signature

export declare const Schemable: Schemable1<'Eq'>

Added in v2.2.8

WithRefine

Signature

export declare const WithRefine: WithRefine1<'Eq'>

Added in v2.2.8

WithUnknownContainers

Signature

export declare const WithUnknownContainers: WithUnknownContainers1<'Eq'>

Added in v2.2.8

primitives

UnknownArray

Signature

export declare const UnknownArray: E.Eq<unknown[]>

Added in v2.2.2

UnknownRecord

Signature

export declare const UnknownRecord: E.Eq<Record<string, unknown>>

Added in v2.2.2

boolean

Signature

export declare const boolean: E.Eq<boolean>

Added in v2.2.2

number

Signature

export declare const number: E.Eq<number>

Added in v2.2.2

string

Signature

export declare const string: E.Eq<string>

Added in v2.2.2

utils

TypeOf (type alias)

Signature

export type TypeOf<E> = E extends Eq<infer A> ? A : never

Added in v2.2.2

URI (type alias)

Signature

export type URI = E.URI

Added in v2.2.3