<commit_before>=begin pod

=TITLE class Nil

=SUBTITLE Nothing

    class Nil is Iterator { }

Represents an empty list in list context, and an undefined value in item
context.


=head1 Methods
<commit_msg>Add a few examples for Nil; jnthn++ for the 'evaporation' example<commit_after>=begin pod

=TITLE class Nil

=SUBTITLE Nothing

    class Nil is Iterator { }

Represents an empty list in list context, and an undefined value in item
context.

C<Nil>, when assigned, evaporates into the type object of the type of the
container you assigned it into.

	my Int $x = 42;
	$x = Nil;
	$x.say;				# (Int)

It is for this reason that assigning an untyped container as C<Nil> will result
in an C<(Any)> object.

	my $x = Nil;
	$x.say;				# (Any)
	my Int $y = $x;		# error:	Type check failed in assignment to '$y'; expected 'Int' but got 'Any'

This is because an untyped container is C<Any> until proven otherwise, and
the C<Nil> evaporates

If you are looking for a variable which transforms objects into type objects
when said variable appears on the RHS, you can type the container as C<Nil>.

	my Nil $x;
	my Str $s = $x;
	$s.say;				# (Str)

=head1 Methods

{'fraction_non_alphanumeric': 0.08203799654576857, 'fraction_numerical': 0.0034542314335060447, 'mean_word_length': 3.6733870967741935, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7272480', 'n_tokens_mistral': 407, 'n_tokens_neox': 373, 'n_words': 181}