<commit_before>part of map_bench;

class PersistentMapInterface<K, V>
  extends EncapsulatingInterface<K, V, PersistentMap<K, V>>{
    
  create() => object = new PersistentMap<K, V>();
  
  insert(K key, V value, V combine(V left, V right)) =>
    object = object.insert(key, value, combine);
  
  lookup(K key) => object.lookup(key, ()=>null);
  
  delete(K key) => object = object.delete(key, safe: true);
  
  _copy() => object;
}

  
class TransientMapInterface<K, V>
  extends EncapsulatingInterface<K, V, TransientMap<K, V>>{
    
  create() => object = new PersistentMap<K, V>().asTransient();
  
  insert(K key, V value, V combine(V left, V right)) =>
    object.doInsert(key, value, combine);
  
  lookup(K key) => object.lookup(key, ()=>null);
  
  delete(K key) => object.doDelete(key, safe: true);
  
  _copy(){
    var copy = object.asPersistent();
    object = copy.asTransient();
    return copy.asTransient();
  }
}

    
class StandardMapInterface<K, V><commit_msg>MapBench: lookup: fixed orElse as positional<commit_after>part of map_bench;

class PersistentMapInterface<K, V>
  extends EncapsulatingInterface<K, V, PersistentMap<K, V>>{
    
  create() => object = new PersistentMap<K, V>();
  
  insert(K key, V value, V combine(V left, V right)) =>
    object = object.insert(key, value, combine);
  
  lookup(K key) => object.lookup(key, orElse: ()=>null);
  
  delete(K key) => object = object.delete(key, safe: true);
  
  _copy() => object;
}

  
class TransientMapInterface<K, V>
  extends EncapsulatingInterface<K, V, TransientMap<K, V>>{
    
  create() => object = new PersistentMap<K, V>().asTransient();
  
  insert(K key, V value, V combine(V left, V right)) =>
    object.doInsert(key, value, combine);
  
  lookup(K key) => object.lookup(key, orElse: ()=>null);
  
  delete(K key) => object.doDelete(key, safe: true);
  
  _copy(){
    var copy = object.asPersistent();
    object = copy.asTransient();
    return copy.asTransient();
  }
}

    
class StandardMapInterface<K, V>
{'fraction_non_alphanumeric': 0.15797317436661698, 'fraction_numerical': 0.0, 'mean_word_length': 3.8413461538461537, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 43, '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': '961456', 'n_tokens_mistral': 708, 'n_tokens_neox': 707, 'n_words': 178}