<B extends string>(that: B): <A extends string>(self: A) => Concat<A, B>
<A extends string, B extends string>(self: A, that: B): Concat<A, B>Concatenates two strings at runtime.
Example (Concatenating strings)
import { pipe, String } from "effect"
const result1 = String.concat("hello", "world")
console.log(result1) // "helloworld"
const result2 = pipe("hello", String.concat("world"))
console.log(result2) // "helloworld"combining
Source effect/String.ts:1544 lines
export const const concat: {
<B extends string>(that: B): <A extends string>(
self: A
) => Concat<A, B>
<A extends string, B extends string>(
self: A,
that: B
): Concat<A, B>
}
Concatenates two strings at runtime.
Example (Concatenating strings)
import { pipe, String } from "effect"
const result1 = String.concat("hello", "world")
console.log(result1) // "helloworld"
const result2 = pipe("hello", String.concat("world"))
console.log(result2) // "helloworld"
concat: {
<function (type parameter) B in <B extends string>(that: B): <A extends string>(self: A) => Concat<A, B>B extends string>(that: B extends stringthat: function (type parameter) B in <B extends string>(that: B): <A extends string>(self: A) => Concat<A, B>B): <function (type parameter) A in <A extends string>(self: A): Concat<A, B>A extends string>(self: A extends stringself: function (type parameter) A in <A extends string>(self: A): Concat<A, B>A) => type Concat<
A extends string,
B extends string
> = `${A}${B}`
Concatenates two strings at the type level.
Example (Concatenating string literal types)
import type { String } from "effect"
// Type-level concatenation
type Result = String.Concat<"hello", "world"> // "helloworld"
Concat<function (type parameter) A in <A extends string>(self: A): Concat<A, B>A, function (type parameter) B in <B extends string>(that: B): <A extends string>(self: A) => Concat<A, B>B>
<function (type parameter) A in <A extends string, B extends string>(self: A, that: B): Concat<A, B>A extends string, function (type parameter) B in <A extends string, B extends string>(self: A, that: B): Concat<A, B>B extends string>(self: A extends stringself: function (type parameter) A in <A extends string, B extends string>(self: A, that: B): Concat<A, B>A, that: B extends stringthat: function (type parameter) B in <A extends string, B extends string>(self: A, that: B): Concat<A, B>B): type Concat<
A extends string,
B extends string
> = `${A}${B}`
Concatenates two strings at the type level.
Example (Concatenating string literal types)
import type { String } from "effect"
// Type-level concatenation
type Result = String.Concat<"hello", "world"> // "helloworld"
Concat<function (type parameter) A in <A extends string, B extends string>(self: A, that: B): Concat<A, B>A, function (type parameter) B in <A extends string, B extends string>(self: A, that: B): Concat<A, B>B>
} = import dualdual(2, (self: stringself: string, that: stringthat: string): string => self: stringself + that: stringthat)