#!/usr/bin/perl
#
# eg18: first lazylist example
#

use strict;
use warnings;
use Function::Parameters qw(:strict);

use List;
$List::as_string_limit = 8;

# list_upto: return a non-lazy list of numbers between $min and $max
fun list_upto( $min, $max )
{
	return List->nil() if $min > $max;
	return List->cons( $min, list_upto($min+1, $max) );
}

my $list = list_upto( 100, 200 );
print "first few elements of upto(100,200) List: $list\n";
