A Cord
is a purely functional data structure for efficiently creating a
String
from smaller parts, useful for printing ADTs that must write out
their contents into a text format.
A z
interpolator is available for building String
from literals, using
the Show
typeclass to populate each "hole", and a cord
interpolator
for building Cord
instances.
If a more efficient solution is required to write a large String
to a
network socket or file, consider https://github.com/scalaz/scalaz/issues/1797
If you require a general text manipulation data structure, consider using
FingerTree
or creating a custom structure to resemble that used by the
popular text editors:
- Companion
- object
Value members
Concrete methods
Strict evaluation variant of Monoid.append
that associates to the right,
therefore building more optimal data structures.
Strict evaluation variant of Monoid.append
that associates to the right,
therefore building more optimal data structures.
Evaluates and stores the String represented by this, returning an equivalent Cord.
Evaluates and stores the String represented by this, returning an equivalent Cord.
Explicitly construct the output String represented by this Cord
Explicitly construct the output String represented by this Cord