瀏覽代碼

Checkpoint for sticky refactor

Billy Barrow 4 天之前
父節點
當前提交
332d986f63

+ 13 - 1
src/lib/ByteComposition.vala

@@ -2,7 +2,7 @@ using Invercargill.DataStructures;
 
 namespace Invercargill {
 
-    public class ByteComposition : Composition<uint8>, BinaryData {
+    public class ByteComposition : Composition<uint8>, Equatable<Enumerable<uint8>>, Hashable, Sticky<BinaryData, uint8>, BinaryData {
 
         public Endianness endianness { get; set; }
 
@@ -210,6 +210,18 @@ namespace Invercargill {
             return amount != 0;
         }
 
+        public bool equals(Enumerable<uint8> other) {
+            return this == other || matches(other, (a, b) => a == b);
+        }
+
+        public uint hash_code() {
+            return aggregate<uint>(5381, (h, b) => h * 33 + b);
+        }
+
+        protected BinaryData adhere(Enumerable<uint8> enumerable) {
+            return enumerable.assert_promotion<BinaryData>();
+        }
+
     }
 
 }

+ 5 - 1
src/lib/DataStructures/ByteBuffer.vala

@@ -1,7 +1,7 @@
 
 namespace Invercargill.DataStructures {
 
-    public class ByteBuffer : Buffer<uint8>, BinaryData, Equatable<Enumerable<uint8>>, Hashable, ReadOnlyAddressableBytes, AddressableBytes {
+    public class ByteBuffer : Buffer<uint8>, Equatable<Enumerable<uint8>>, Hashable, Sticky<BinaryData, uint8>, BinaryData, ReadOnlyAddressableBytes, AddressableBytes {
 
         public ByteBuffer(uint size) {
             base(size);
@@ -15,6 +15,10 @@ namespace Invercargill.DataStructures {
             return aggregate<uint>(5381, (h, b) => h * 33 + b);
         }
 
+        protected BinaryData adhere(Enumerable<uint8> enumerable) {
+            return enumerable.assert_promotion<BinaryData>();
+        }
+
         public ByteBuffer.from_enumerable(Enumerable<uint8> data) {
             base.take_array(data.to_array());
         }

+ 1 - 1
src/lib/Interfaces/BinaryData.vala

@@ -2,7 +2,7 @@ using Invercargill.DataStructures;
 
 namespace Invercargill {
 
-    public interface BinaryData : Enumerable<uint8> {
+    public interface BinaryData : Enumerable<uint8>, Sticky<BinaryData, uint8>, Equatable<Enumerable<uint8>>, Hashable {
 
         public virtual string to_raw_string(bool null_terminate = true) {
             Enumerable<uint8> data = this;

+ 1 - 1
src/lib/Interfaces/ReadOnlyAddressableBytes.vala

@@ -9,7 +9,7 @@ namespace Invercargill {
 
 
     [GenericAccessors]
-    public interface ReadOnlyAddressableBytes : ReadOnlyAddressable<uint8>, Equatable<Enumerable<uint8>>, BinaryData, Hashable  {
+    public interface ReadOnlyAddressableBytes : ReadOnlyAddressable<uint8>, Hashable, Equatable<Enumerable<uint8>>, Sticky<BinaryData, uint8>, BinaryData  {
 
         public virtual int64? get_int64(uint index, Endianness endianness = Endianness.Native) throws IndexError {
             var data = get_slice(index, sizeof(int64));

+ 15 - 3
src/lib/Promotions/BinaryData.vala

@@ -2,17 +2,29 @@ using Invercargill.Mapping;
 
 namespace Invercargill {
 
-    private class BinaryDataPromotionImplementation : Proxy<uint8>, Promotion<uint8>, BinaryData {
+    private class BinaryDataPromotionImplementation : StickyPromotion<uint8, BinaryData>, Promotion<uint8>, Equatable<Enumerable<uint8>>, Hashable, BinaryData {
 
-        public Enumerable<uint8> wrap (Enumerable<uint8> enumerable) {
+        public override Enumerable<uint8> wrap (Enumerable<uint8> enumerable) {
             inner = enumerable;
             return this;
         }
 
-        public bool can_wrap (GLib.Type element_type) {
+        public override bool can_wrap (GLib.Type element_type) {
             return element_type.is_a (typeof(uint8));
         }
 
+        public bool equals(Enumerable<uint8> other) {
+            return this == other || matches(other, (a, b) => a == b);
+        }
+
+        public uint hash_code() {
+            return aggregate<uint>(5381, (h, b) => h * 33 + b);
+        }
+
+        protected override BinaryData adhere (Enumerable<uint8> enumerable) {
+            return (BinaryData)new BinaryDataPromotionImplementation().wrap(enumerable);
+        }
+
     }
 
 }

+ 1 - 1
src/lib/Promotions/Equatables.vala

@@ -11,7 +11,7 @@ namespace Invercargill {
             return this;
         }
 
-        protected override Equatables<T> rewrap(Enumerable<T> enumerable) {
+        protected override Equatables<T> adhere(Enumerable<T> enumerable) {
             return (Equatables<T>)new Equatables<T>().wrap(enumerable);
         }
 

+ 12 - 12
src/lib/Promotions/Numbers/Implementations.vala

@@ -1,7 +1,7 @@
 namespace Invercargill {
 
     public class SignedNativeIntegers : Numbers<int, SignedNativeIntegers> {
-        protected override SignedNativeIntegers rewrap(Enumerable<int> enumerable) {
+        protected override SignedNativeIntegers adhere(Enumerable<int> enumerable) {
             return (SignedNativeIntegers)new SignedNativeIntegers().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -37,7 +37,7 @@ namespace Invercargill {
     }
 
     public class UnsignedNativeIntegers : Numbers<uint, UnsignedNativeIntegers> {
-        protected override UnsignedNativeIntegers rewrap(Enumerable<uint> enumerable) {
+        protected override UnsignedNativeIntegers adhere(Enumerable<uint> enumerable) {
             return (UnsignedNativeIntegers)new UnsignedNativeIntegers().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -73,7 +73,7 @@ namespace Invercargill {
     }
 
     public class Signed8BitIntegers : Numbers<int8, Signed8BitIntegers> {
-        protected override Signed8BitIntegers rewrap(Enumerable<int8> enumerable) {
+        protected override Signed8BitIntegers adhere(Enumerable<int8> enumerable) {
             return (Signed8BitIntegers)new Signed8BitIntegers().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -109,7 +109,7 @@ namespace Invercargill {
     }
 
     public class Unsigned8BitIntegers : Numbers<uint8, Unsigned8BitIntegers> {
-        protected override Unsigned8BitIntegers rewrap(Enumerable<uint8> enumerable) {
+        protected override Unsigned8BitIntegers adhere(Enumerable<uint8> enumerable) {
             return (Unsigned8BitIntegers)new Unsigned8BitIntegers().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -145,7 +145,7 @@ namespace Invercargill {
     }
 
     public class Signed16BitIntegers : Numbers<int16, Signed16BitIntegers> {
-        protected override Signed16BitIntegers rewrap(Enumerable<int16> enumerable) {
+        protected override Signed16BitIntegers adhere(Enumerable<int16> enumerable) {
             return (Signed16BitIntegers)new Signed16BitIntegers().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -181,7 +181,7 @@ namespace Invercargill {
     }
 
     public class Unsigned16BitIntegers : Numbers<uint16, Unsigned16BitIntegers> {
-        protected override Unsigned16BitIntegers rewrap(Enumerable<uint16> enumerable) {
+        protected override Unsigned16BitIntegers adhere(Enumerable<uint16> enumerable) {
             return (Unsigned16BitIntegers)new Unsigned16BitIntegers().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -217,7 +217,7 @@ namespace Invercargill {
     }
 
     public class Signed32BitIntegers : Numbers<int32, Signed32BitIntegers> {
-        protected override Signed32BitIntegers rewrap(Enumerable<int32> enumerable) {
+        protected override Signed32BitIntegers adhere(Enumerable<int32> enumerable) {
             return (Signed32BitIntegers)new Signed32BitIntegers().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -253,7 +253,7 @@ namespace Invercargill {
     }
 
     public class Unsigned32BitIntegers : Numbers<uint32, Unsigned32BitIntegers> {
-        protected override Unsigned32BitIntegers rewrap(Enumerable<uint32> enumerable) {
+        protected override Unsigned32BitIntegers adhere(Enumerable<uint32> enumerable) {
             return (Unsigned32BitIntegers)new Unsigned32BitIntegers().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -289,7 +289,7 @@ namespace Invercargill {
     }
 
     public class Signed64BitIntegers : Numbers<int64?, Signed64BitIntegers> {
-        protected override Signed64BitIntegers rewrap(Enumerable<int64?> enumerable) {
+        protected override Signed64BitIntegers adhere(Enumerable<int64?> enumerable) {
             return (Signed64BitIntegers)new Signed64BitIntegers().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -325,7 +325,7 @@ namespace Invercargill {
     }
 
     public class Unsigned64BitIntegers : Numbers<uint64?, Unsigned64BitIntegers> {
-        protected override Unsigned64BitIntegers rewrap(Enumerable<uint64?> enumerable) {
+        protected override Unsigned64BitIntegers adhere(Enumerable<uint64?> enumerable) {
             return (Unsigned64BitIntegers)new Unsigned64BitIntegers().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -361,7 +361,7 @@ namespace Invercargill {
     }
 
     public class Doubles : Numbers<double?, Doubles> {
-        protected override Doubles rewrap(Enumerable<double?> enumerable) {
+        protected override Doubles adhere(Enumerable<double?> enumerable) {
             return (Doubles)new Doubles().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {
@@ -397,7 +397,7 @@ namespace Invercargill {
     }
 
     public class Floats : Numbers<float?, Floats> {
-        protected override Floats rewrap(Enumerable<float?> enumerable) {
+        protected override Floats adhere(Enumerable<float?> enumerable) {
             return (Floats)new Floats().wrap(enumerable);
         }
         public override bool can_wrap(GLib.Type element_type) {

+ 1 - 1
src/lib/Promotions/PropertyGroups.vala

@@ -9,7 +9,7 @@ namespace Invercargill {
             return this;
         }
 
-        protected override PropertyGroups rewrap(Enumerable<Properties> enumerable) {
+        protected override PropertyGroups adhere(Enumerable<Properties> enumerable) {
             return (PropertyGroups)new PropertyGroups().wrap(enumerable);
         }
 

+ 113 - 0
src/lib/Sticky.vala

@@ -0,0 +1,113 @@
+namespace Invercargill {
+
+    public interface Sticky<TEnumerable, T> : Enumerable<T> {
+
+        protected abstract TEnumerable adhere(Enumerable<T> enumerable);
+
+        public virtual new TEnumerable where(owned PredicateDelegate<T> predicate) {
+            return adhere(((Enumerable<T>)this).where((owned)predicate));
+        }
+        public virtual new TEnumerable from(owned PredicateDelegate<T> predicate) {
+            return adhere(((Enumerable<T>)this).from((owned)predicate));
+        }
+        public virtual new TEnumerable until(owned PredicateDelegate<T> predicate) {
+            return adhere(((Enumerable<T>)this).until((owned)predicate));
+        }
+        public virtual new TEnumerable sort(owned CompareDelegate<T> compare) {
+            return adhere(((Enumerable<T>)this).sort((owned)compare));
+        }
+        public virtual new TEnumerable order_by<TKey>(owned TransformDelegate<T, TKey> key_selector, owned CompareDelegate<TKey>? comparitor = null) {
+            return adhere(((Enumerable<T>)this).order_by<TKey>((owned)key_selector, comparitor));
+        }
+        public virtual new TEnumerable order_by_descending<TKey>(owned TransformDelegate<T, TKey> key_selector, owned CompareDelegate<TKey>? comparitor = null) {
+            return adhere(((Enumerable<T>)this).order_by_descending<TKey>((owned)key_selector, comparitor));
+        }
+        public virtual new TEnumerable order_by_complex(ItemDelegate<OrderConfiguration<T>> config) {
+            return adhere(((Enumerable<T>)this).order_by_complex(config));
+        }
+        public virtual new TEnumerable concat(Enumerable<T> other) {
+            return adhere(((Enumerable<T>)this).concat(other));
+        }
+        public virtual new TEnumerable take(uint count) {
+            return adhere(((Enumerable<T>)this).take(count));
+        }
+        public virtual new TEnumerable skip(uint count) {
+            return adhere(((Enumerable<T>)this).skip(count));
+        }
+        public virtual new TEnumerable skip_last(uint count) {
+            return adhere(((Enumerable<T>)this).skip_last(count));
+        }
+        public virtual new TEnumerable take_last(uint count) {
+            return adhere(((Enumerable<T>)this).take_last(count));
+        }
+        public virtual new TEnumerable distinct(owned EqualityDelegate<T>? comparison = null) {
+            return adhere(((Enumerable<T>)this).distinct((owned)comparison));
+        }
+        public virtual new TEnumerable distinct_by<TProp>(owned TransformDelegate<T, TProp> property_selector, owned EqualityDelegate<TProp>? property_equality) {
+            return adhere(((Enumerable<T>)this).distinct_by<TProp>((owned)property_selector, property_equality));
+        }
+        public virtual new TEnumerable reverse() {
+            return adhere(((Enumerable<T>)this).reverse());
+        }
+        public virtual new TEnumerable cycle(uint cycles = -1) {
+            return adhere(((Enumerable<T>)this).cycle(cycles));
+        }
+        public virtual new TEnumerable prefix_with(T item, uint times = 1) {
+            return adhere(((Enumerable<T>)this).prefix_with(item, times));
+        }
+        public virtual new TEnumerable suffix_with(T item, uint times = 1) {
+            return adhere(((Enumerable<T>)this).suffix_with(item, times));
+        }
+        public virtual new TEnumerable pad_end(uint minimum_length, T pad_item) {
+            return adhere(((Enumerable<T>)this).pad_end(minimum_length, pad_item));
+        }
+        public virtual new TEnumerable pad_start(uint minimum_length, T pad_item) {
+            return adhere(((Enumerable<T>)this).pad_start(minimum_length, pad_item));
+        }
+        public virtual new TEnumerable seal() {
+            return adhere(((Enumerable<T>)this).seal());
+        }
+        public virtual new TEnumerable cache() {
+            return adhere(((Enumerable<T>)this).cache());
+        }
+        public virtual new TEnumerable act(ItemDelegate<T> handler) {
+            return adhere(((Enumerable<T>)this).act(handler));
+        }
+        public virtual new TEnumerable debug_trace(string additional_message = "", owned StringifyDelegate<T>? stringifier = null, owned DebugOutputDelegate? output_func = null, bool formatting = true) {
+            return adhere(((Enumerable<T>)this).debug_trace(additional_message, stringifier, output_func, formatting));
+        }
+        public virtual new TEnumerable debug_type(string additional_message = "", DebugOutputDelegate? output_func = null, bool formatting = true) {
+            return adhere(((Enumerable<T>)this).debug_type(additional_message, output_func, formatting));
+        }
+        public virtual new TEnumerable combine_by<TKey>(Enumerable<T> other, owned TransformDelegate<T, TKey> key_selector, owned HashDelegate<TKey>? hash_func = null, owned EqualityDelegate<TKey>? equal_func = null) {
+            return adhere(((Enumerable<T>)this).combine_by<TKey>(other, (owned)key_selector, hash_func, equal_func));
+        }
+        public virtual new TEnumerable combine(Enumerable<T> other, owned HashDelegate<T>? hash_func = null, owned EqualityDelegate<T>? equal_func = null) {
+            return adhere(((Enumerable<T>)this).combine(other, hash_func, equal_func));
+        }
+        public virtual new TEnumerable common_by<TKey>(Enumerable<T> other, owned TransformDelegate<T, TKey> key_selector, owned HashDelegate<TKey>? hash_func = null, owned EqualityDelegate<TKey>? equal_func = null) {
+            return adhere(((Enumerable<T>)this).common_by<TKey>(other, (owned)key_selector, hash_func, equal_func));
+        }
+        public virtual new TEnumerable common(Enumerable<T> other, owned HashDelegate<T>? hash_func = null, owned EqualityDelegate<T>? equal_func = null) {
+            return adhere(((Enumerable<T>)this).common(other, hash_func, equal_func));
+        }
+        public virtual new TEnumerable exclude_by<TKey>(Enumerable<T> other, owned TransformDelegate<T, TKey> key_selector, owned HashDelegate<TKey>? hash_func = null, owned EqualityDelegate<TKey>? equal_func = null) {
+            return adhere(((Enumerable<T>)this).exclude_by<TKey>(other, (owned)key_selector, hash_func, equal_func));
+        }
+        public virtual new TEnumerable exclude(Enumerable<T> other, owned HashDelegate<T>? hash_func = null, owned EqualityDelegate<T>? equal_func = null) {
+            return adhere(((Enumerable<T>)this).exclude(other, hash_func, equal_func));
+        }
+        public virtual new TEnumerable non_common_by<TKey>(Enumerable<T> other, owned TransformDelegate<T, TKey> key_selector, owned HashDelegate<TKey>? hash_func = null, owned EqualityDelegate<TKey>? equal_func = null) {
+            return adhere(((Enumerable<T>)this).non_common_by<TKey>(other, (owned)key_selector, hash_func, equal_func));
+        }
+        public virtual new TEnumerable non_common(Enumerable<T> other, owned HashDelegate<T>? hash_func = null, owned EqualityDelegate<T>? equal_func = null) {
+            return adhere(((Enumerable<T>)this).non_common(other, hash_func, equal_func));
+        }
+        public virtual new TEnumerable interleave(Enumerable<T> other) {
+            return adhere(((Enumerable<T>)this).interleave(other));
+        }
+        public virtual new TEnumerable parallel_where<T>(owned PredicateDelegate<T> predicate, uint workers = 0) {
+            return adhere(((Enumerable<T>)this).parallel_where<T>((owned)predicate, workers));
+        }
+    }
+}

+ 1 - 1
src/lib/StickyPromotion.vala

@@ -5,7 +5,7 @@ namespace Invercargill {
         public abstract Enumerable<T> wrap(Enumerable<T> enumerable);
         public abstract bool can_wrap(GLib.Type element_type);
 
-        public override TPromotion recycle() {
+        public override TPromotion passthrough() {
             return (TPromotion)wrap(inner);
         }
     }

+ 38 - 38
src/lib/StickyProxy.vala

@@ -3,150 +3,150 @@ using Invercargill.Mapping;
 
 namespace Invercargill {
 
-    public abstract class StickyProxy<TEnumerable, T> : Proxy<T> {
+    public abstract class StickyProxy<TEnumerable, T> : Proxy<T>, Sticky<TEnumerable, T> {
 
-        protected abstract TEnumerable rewrap(Enumerable<T> enumerable);
-        protected abstract TEnumerable recycle();
+        protected abstract TEnumerable adhere(Enumerable<T> enumerable);
+        protected abstract TEnumerable passthrough();
 
         public new TEnumerable where(owned PredicateDelegate<T> predicate) {
-            return rewrap(inner.where((owned)predicate));
+            return adhere(inner.where((owned)predicate));
         }
     
         public new TEnumerable from(owned PredicateDelegate<T> predicate) {
-            return rewrap(inner.from((owned)predicate));
+            return adhere(inner.from((owned)predicate));
         }
     
         public new TEnumerable until(owned PredicateDelegate<T> predicate) {
-            return rewrap(inner.until((owned)predicate));
+            return adhere(inner.until((owned)predicate));
         }
     
         public new TEnumerable sort(owned CompareDelegate<T> compare) {
-            return rewrap(inner.sort((owned)compare));
+            return adhere(inner.sort((owned)compare));
         }
     
         public new TEnumerable order_by<TKey>(owned TransformDelegate<T, TKey> key_selector, owned CompareDelegate<TKey>? comparitor = null) {
-            return rewrap(inner.order_by<TKey>((owned)key_selector, (owned)comparitor));
+            return adhere(inner.order_by<TKey>((owned)key_selector, (owned)comparitor));
         }
     
         public new TEnumerable order_by_descending<TKey>(owned TransformDelegate<T, TKey> key_selector, owned CompareDelegate<TKey>? comparitor = null) {
-            return rewrap(inner.order_by_descending<TKey>((owned)key_selector, (owned)comparitor));
+            return adhere(inner.order_by_descending<TKey>((owned)key_selector, (owned)comparitor));
         }
     
         public new TEnumerable order_by_complex(ItemDelegate<OrderConfiguration<T>> config) {
-            return rewrap(inner.order_by_complex(config));
+            return adhere(inner.order_by_complex(config));
         }
     
         public new TEnumerable concat(Enumerable<T> other) {
-            return rewrap(inner.concat(other));
+            return adhere(inner.concat(other));
         }
     
         public new TEnumerable take(uint count) {
-            return rewrap(inner.take(count));
+            return adhere(inner.take(count));
         }
     
         public new TEnumerable skip(uint count) {
-            return rewrap(inner.skip(count));
+            return adhere(inner.skip(count));
         }
     
         public new TEnumerable skip_last(uint count) {
-            return rewrap(inner.skip_last(count));
+            return adhere(inner.skip_last(count));
         }
     
         public new TEnumerable take_last(uint count) {
-            return rewrap(inner.take_last(count));
+            return adhere(inner.take_last(count));
         }
     
         public new TEnumerable distinct(owned EqualityDelegate<T>? comparison = null) {
-            return rewrap(inner.distinct((owned)comparison));
+            return adhere(inner.distinct((owned)comparison));
         }
     
         public new TEnumerable distinct_by<TProp>(owned TransformDelegate<T, TProp> property_selector, owned EqualityDelegate<TProp>? property_equality) {
-            return rewrap(inner.distinct_by<TProp>((owned)property_selector, (owned)property_equality));
+            return adhere(inner.distinct_by<TProp>((owned)property_selector, (owned)property_equality));
         }
     
         public new TEnumerable reverse() {
-            return rewrap(inner.reverse());
+            return adhere(inner.reverse());
         }
     
         public new TEnumerable cycle(uint cycles = -1) {
-            return rewrap(inner.cycle(cycles));
+            return adhere(inner.cycle(cycles));
         }
     
         public new TEnumerable prefix_with(T item, uint times = 1) {
-            return rewrap(inner.prefix_with(item, times));
+            return adhere(inner.prefix_with(item, times));
         }
     
         public new TEnumerable suffix_with(T item, uint times = 1) {
-            return rewrap(inner.suffix_with(item, times));
+            return adhere(inner.suffix_with(item, times));
         }
     
         public new TEnumerable pad_end(uint minimum_length, T pad_item) {
-            return rewrap(inner.pad_end(minimum_length, pad_item));
+            return adhere(inner.pad_end(minimum_length, pad_item));
         }
     
         public new TEnumerable pad_start(uint minimum_length, T pad_item) {
-            return rewrap(inner.pad_start(minimum_length, pad_item));
+            return adhere(inner.pad_start(minimum_length, pad_item));
         }
     
         public new TEnumerable seal() {
-            return rewrap(inner.seal());
+            return adhere(inner.seal());
         }
 
         public new TEnumerable cache() {
-            return rewrap(inner.cache());
+            return adhere(inner.cache());
         }
 
         public new TEnumerable act(ItemDelegate<T> handler) {
-            return rewrap(inner.act(handler));
+            return adhere(inner.act(handler));
         }
 
         public new TEnumerable debug_trace(string additional_message = "", owned StringifyDelegate<T>? stringifier = null, owned DebugOutputDelegate? output_func = null, bool formatting = true) {
-            return rewrap(new TraceEnumerable<T>(this, get_info(), (owned)stringifier, additional_message, (owned)output_func, formatting));
+            return adhere(new TraceEnumerable<T>(this, get_info(), (owned)stringifier, additional_message, (owned)output_func, formatting));
         }
 
         public new TEnumerable debug_type(string additional_message = "", DebugOutputDelegate? output_func = null, bool formatting = true) {
             DebugPrinter.print_enumerable_information(get_info(), additional_message, output_func, formatting);
-            return recycle();
+            return passthrough();
         }
         
         public new TEnumerable combine_by<TKey>(Enumerable<T> other, owned TransformDelegate<T, TKey> key_selector, owned HashDelegate<TKey>? hash_func = null, owned EqualityDelegate<TKey>? equal_func = null) {
-            return rewrap(inner.combine_by<TKey>(other, (owned)key_selector, (owned)hash_func, (owned)equal_func));
+            return adhere(inner.combine_by<TKey>(other, (owned)key_selector, (owned)hash_func, (owned)equal_func));
         }
         
         public new TEnumerable combine(Enumerable<T> other, owned HashDelegate<T>? hash_func = null, owned EqualityDelegate<T>? equal_func = null) {
-            return rewrap(inner.combine(other, (owned)hash_func, (owned)equal_func));
+            return adhere(inner.combine(other, (owned)hash_func, (owned)equal_func));
         }
         
         public new TEnumerable common_by<TKey>(Enumerable<T> other, owned TransformDelegate<T, TKey> key_selector, owned HashDelegate<TKey>? hash_func = null, owned EqualityDelegate<TKey>? equal_func = null) {
-            return rewrap(inner.common_by<TKey>(other, (owned)key_selector, (owned)hash_func, (owned)equal_func));
+            return adhere(inner.common_by<TKey>(other, (owned)key_selector, (owned)hash_func, (owned)equal_func));
         }
         
         public new TEnumerable common(Enumerable<T> other, owned HashDelegate<T>? hash_func = null, owned EqualityDelegate<T>? equal_func = null) {
-            return rewrap(inner.common(other, (owned)hash_func, (owned)equal_func));
+            return adhere(inner.common(other, (owned)hash_func, (owned)equal_func));
         }
         
         public new TEnumerable exclude_by<TKey>(Enumerable<T> other, owned TransformDelegate<T, TKey> key_selector, owned HashDelegate<TKey>? hash_func = null, owned EqualityDelegate<TKey>? equal_func = null) {
-            return rewrap(inner.exclude_by<TKey>(other, (owned)key_selector, (owned)hash_func, (owned)equal_func));
+            return adhere(inner.exclude_by<TKey>(other, (owned)key_selector, (owned)hash_func, (owned)equal_func));
         }
         
         public new TEnumerable exclude(Enumerable<T> other, owned HashDelegate<T>? hash_func = null, owned EqualityDelegate<T>? equal_func = null) {
-            return rewrap(inner.exclude(other, (owned)hash_func, (owned)equal_func));
+            return adhere(inner.exclude(other, (owned)hash_func, (owned)equal_func));
         }
         
         public new TEnumerable non_common_by<TKey>(Enumerable<T> other, owned TransformDelegate<T, TKey> key_selector, owned HashDelegate<TKey>? hash_func = null, owned EqualityDelegate<TKey>? equal_func = null) {
-            return rewrap(inner.non_common_by<TKey>(other, (owned)key_selector, (owned)hash_func, (owned)equal_func));
+            return adhere(inner.non_common_by<TKey>(other, (owned)key_selector, (owned)hash_func, (owned)equal_func));
         }
         
         public new TEnumerable non_common(Enumerable<T> other, owned HashDelegate<T>? hash_func = null, owned EqualityDelegate<T>? equal_func = null) {
-            return rewrap(inner.non_common(other, (owned)hash_func, (owned)equal_func));
+            return adhere(inner.non_common(other, (owned)hash_func, (owned)equal_func));
         }
         
         public new TEnumerable interleave(Enumerable<T> other) {
-            return rewrap(inner.interleave(other));
+            return adhere(inner.interleave(other));
         }
         
         public new TEnumerable parallel_where<T>(owned PredicateDelegate<T> predicate, uint workers = 0) {
-            return rewrap(inner.parallel_where<T>((owned)predicate, workers));
+            return adhere(inner.parallel_where<T>((owned)predicate, workers));
         }
 
     }

+ 2 - 1
src/lib/meson.build

@@ -37,6 +37,7 @@ sources += files('Wrap.vala')
 sources += files('Partition.vala')
 sources += files('Composition.vala')
 sources += files('ByteComposition.vala')
+sources += files('Sticky.vala')
 
 sources += files('Modifiers/Transform.vala')
 sources += files('Modifiers/Filter.vala')
@@ -150,4 +151,4 @@ custom_target('invercargill typelib', command: [g_ir_compiler, '--shared-library
               depends: invercargill,
               install: true,
               install_dir: get_option('libdir') / 'girepository-1.0')
-              
+