[det]atom_graphemes(?Atom,
?Graphemes)e + U+0301 are both one grapheme, an
emoji ZWJ sequence such as MAN + ZWJ + WOMAN + ZWJ + GIRL
is one grapheme, and a regional-indicator pair (e.g. U+1F1F3 U+1F1F1,
rendered as the Dutch flag) is one grapheme.
In the forward mode (+Atom, ?Graphemes), Atom is decomposed into a list of atoms, each covering one cluster. In the reverse mode (?Atom, +Graphemes), the elements of Graphemes are concatenated into Atom. Both arguments instantiated means both modes run and the result must agree.
?- atom_codes(A, [0'c, 0'a, 0'f, 0'e, 0x0301]), atom_graphemes(A, Gs). Gs = [c, a, f, G], atom_codes(G, [0'e, 0x0301]). ?- atom_graphemes(A, [a, b, c]). A = abc.