What is empty?

Thanks, good to see other thoughts.

I was thinking of the representation of a difference list as two separate variables and not as a pair joined (-)/2. Examples found here.

One way I can see the use of a difference list as a pair is that the pair is a new type that hides the underlying separate variables. Feel free to disagree with that, that is the point of the discussion. :slightly_smiling_face:

EDIT

Thinking more about that I checked the ISO Prolog standard and did not know this, but the standard does have a description of a difference list. Point in your favor.

To denote a stream, we use stream(N, Ll - L2), where
N is the abstract name of the stream (not represented in
the formal specification) and LI - L2 is a difference list
of characters. LI represents the whole contents of the
stream and L2 represents the characters after the pointer
(including the pointed first character). Thus an empty
stream is denoted nil - nil and points on the โ€œeofโ€. A
stream L - L, L being a non empty list of characters
points on the first character. A stream L - nil points on
the end of file (the current character is โ€œeofโ€. A stream
A.L - L points on the second and L - A.nil on the last.
Initially a non empty stream pointing on its first element
A will be denoted A. L - A.L.