package utp;

public interface ILazyList<T> {
	public Pair<T, ILazyList<T>> uncons();
	
	public default IActiveGenerator<T> convert()
	{
		Pair<T, ILazyList<T>> pair = uncons();
		return new IActiveGenerator<T>() {
			public T value() throws StopException {
				return pair.fst();
			}
			public IActiveGenerator<T> next() {
				return pair.snd().convert();
			}
		};
	}
}
