<commit_before>module Monadist
  class List < Monad

    attr_reader :values



    def initialize(values)
      @values = values
    end



    def bind(&block)
      List.new values.map(&block).flat_map(&:values)
    end



    def self.unit(value)
      if value.is_a? Array
        new value
      else
        new [value]
      end
    end

  end
end<commit_msg>Use self.class instead of class name to make inheritance easier<commit_after>module Monadist
  class List < Monad

    attr_reader :values



    def initialize(values)
      @values = values
    end



    def bind(&block)
      self.class.new values.map(&block).flat_map(&:values)
    end



    def self.unit(value)
      if value.is_a? Array
        new value
      else
        new [value]
      end
    end

  end
end
{'fraction_non_alphanumeric': 0.0759493670886076, 'fraction_numerical': 0.0, 'mean_word_length': 1.996212121212121, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3907779', 'n_tokens_mistral': 263, 'n_tokens_neox': 239, 'n_words': 70}