Link Search Menu Expand Document

string overview

Added in v2.10.0


Table of contents


instances

Eq

Signature

export declare const Eq: E.Eq<string>

Added in v2.10.0

Monoid

string monoid under concatenation.

The empty value is ''.

Signature

export declare const Monoid: M.Monoid<string>

Example

import * as S from 'fp-ts/string'

assert.deepStrictEqual(S.Monoid.concat('a', 'b'), 'ab')

Added in v2.10.0

Ord

Signature

export declare const Ord: O.Ord<string>

Added in v2.10.0

Semigroup

string semigroup under concatenation.

Signature

export declare const Semigroup: S.Semigroup<string>

Example

import * as S from 'fp-ts/string'

assert.deepStrictEqual(S.Semigroup.concat('a', 'b'), 'ab')

Added in v2.10.0

Show

Signature

export declare const Show: Sh.Show<string>

Added in v2.10.0

utils

empty

An empty string.

Signature

export declare const empty: string

Added in v2.10.0

isEmpty

Test whether a string is empty.

Signature

export declare const isEmpty: (s: string) => boolean

Added in v2.10.0

size

Calculate the number of characters in a string.

Signature

export declare const size: (s: string) => number

Added in v2.10.0