Package: @effect/printer
Module: Doc
The catWithSpace combinator concatenates two documents by placing a
space document between them.
Example
import * as assert from "node:assert"
import * as Doc from "@effect/printer/Doc"
import { pipe } from "effect/Function"
const doc: Doc.Doc<never> = pipe(
Doc.char("a"),
Doc.catWithSpace(Doc.char("b"))
)
assert.strictEqual(
Doc.render(doc, { style: "pretty" }),
"a b"
)
Signature
declare const catWithSpace: { <B>(that: Doc<B>): <A>(self: Doc<A>) => Doc<B | A>; <A, B>(self: Doc<A>, that: Doc<B>): Doc<A | B>; }
Since v1.0.0