<commit_before>﻿using System;
using System.Collections.Generic;

namespace LanguageExt
{
    internal class SeqList<A> : Seq<A>
    {
        readonly IList<A> list;
        readonly int index;
        readonly int count;

        /// <summary>
        /// Construct a new sequence
        /// </summary>
        SeqList(IList<A> list, int index, int count)
        {
            this.list = list;
            this.index = index;
            this.count = count == -1
                ? list.Count - index
                : count;
        }

        public override int Count =><commit_msg>added comment documenting class invariant<commit_after>﻿using System;
using System.Collections.Generic;

namespace LanguageExt
{
    internal class SeqList<A> : Seq<A>
    {
        /*
         * These fields satisfy
         * 0 <= index <  list.Count
         * 0 <  count <= list.Count
         * 0 < index + count <= list.Count
         */
        readonly IList<A> list;
        readonly int index;
        readonly int count;

        /// <summary>
        /// Construct a new sequence
        /// </summary>
        SeqList(IList<A> list, int index, int count)
        {
            this.list = list;
            this.index = index;
            this.count = count == -1
                ? list.Count - index
                : count;
        }

        public override int Count =>
{'fraction_non_alphanumeric': 0.10262008733624454, 'fraction_numerical': 0.00363901018922853, 'mean_word_length': 1.4336283185840708, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 17, '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': '7474441', 'n_tokens_mistral': 379, 'n_tokens_neox': 364, 'n_words': 107}